Image processing method, image processing program, and image processor

ABSTRACT

An image processing method for converting a first image that is expressed in a calorimetric system made up of a plurality of color components and comprises a plurality of pixels each having color information corresponding to one of the color components into a second image that comprises a plurality of pixels each having at least a common type of color information, includes: a color judgment step that includes a color difference information generation step in which color difference information is generated for a processing target pixel in the second image by using color information in the first image through one of at least three different methods and a color evaluation step in which a color evaluation is individually executed for each of processing target pixels in the second image by using the color difference information; and an image conversion step in which the first image is converted to the second image based upon results of the color evaluation executed in the color judgment step.

[0001] The disclosures of the following priority applications are herein incorporated by reference:

[0002] Japanese Patent Application No. 2001-16729 filed Jan. 25, 2001

[0003] Japanese Patent Application No. 2001-343392 filed Nov. 8, 2001

TECHNICAL FIELD

[0004] The present invention relates to an image processing method and the like, through which an image that is expressed in a calorimetric system made up of a plurality of color components and is constituted of a plurality of pixels each providing color information corresponding to a single color component is converted to an image constituted of a plurality of pixels each providing at least a common type of color information.

BACKGROUND ART

[0005] An image-capturing sensor such as a CCD is utilized in an electronic camera or the like to capture an image of a subject. At such an image-capturing sensor, color filters each corresponding to one of, for instance, three colors, R, G and B (red, green and blue) are arranged in a Bayer array, and image data containing color information corresponding to one of the color components, R, G and B are output from each pixel. In the image data a given pixel only contains color information on one color component. Accordingly, various methods for obtaining color information corresponding to color components missing at the pixel through interpolation processing or the like have been proposed.

[0006] Japanese Patent No. 2931520 discloses a technology whereby the color level of a given pixel is detected, a correlational value is adjusted in correspondence to the color level and interpolation processing is executed based upon the adjusted correlational value.

[0007] However, if the image being processed contains a structure, the value indicated by a color difference signal attributable to the structural factor cannot be distinguished from the value of the color difference signal generated due to the actual color of the image area in the color level detection method disclosed in Japanese Patent No. 2931520, and thus, there is a high risk of the correlational value being used incorrectly by mistake.

DISCLOSURE OF THE INVENTION

[0008] The present invention provides an image processing method and the like, through which a high quality color image can be provided by addressing the problem discussed above in an appropriate manner.

[0009] A first image processing method according to the present invention for converting a first image that is expressed in a calorimetric system made up of a plurality of color components and comprises a plurality of pixels each having color information corresponding to one of the color components into a second image that comprises a plurality of pixels each having at least a common type of color information, comprises: a color judgment step that includes a color difference information generation step in which color difference information is generated for a processing target pixel in the second image by using color information in the first image through one of at least three different methods and a color evaluation step in which a color evaluation is individually executed for each of processing target pixels in the second image by using the color difference information; and an image conversion step in which the first image is converted to the second image based upon results of the color evaluation executed in the color judgment step.

[0010] In the first image processing method, it is preferred that: the color judgment step further includes a similarity factor calculation step in which similarity factors corresponding to at least two directions are calculated for the processing target pixel in the second image by using the color information in the first image and a similarity judgment step in which a level of similarity manifesting along each direction is determined to be one of at least three levels based upon the similarity factors; and in the color difference information generation step, the color difference information is generated by using the color information in the first image through one of at least the three methods each corresponding to specific judgment results obtained in the similarity judgment step. In this case, it is preferred that: in the similarity factor calculation step executed during the color judgment step, different color similarity factors each constituted of color information corresponding to different color components are calculated as similarity factors.

[0011] In the first image processing method, it is preferred that the image conversion step includes: 1) a similarity factor calculation step in which different color similarity factors each constituted of color information corresponding to different color components and same color similarity factors each constituted of color information corresponding to a single color component are calculated along at least two directions for the processing target pixel by using the color information in the first image, and similarity factors are obtained by selectively using either the different color similarity factors or the same color similarity factors based upon the results of the color evaluation; 2) a similarity judgment step in which levels of similarity manifesting along the individual directions are judged based upon the similarity factors; and 3) a second image generation step in which color information for the second image is generated by using the color information in the first image based upon judgment results obtained in the similarity judgment step. In this case, it is preferred that: in the similarity factor calculation step executed during the image conversion step, the different color similarity factors are mainly used as the similarity factors when a saturation level is judged to be low in the color evaluation, and the same color similarity factors are mainly used as the similarity factors if the saturation level is judged to be high in the color evaluation.

[0012] In the first image processing method, it is preferred that the image conversion step includes: 1) a similarity factor calculation step in which different color similarity factors each constituted of color information corresponding to different color components and same color similarity factors each constituted of color information corresponding to a single color component are calculated along at least two directions for the processing target pixel by using the color information in the first image and similarity factors are calculated through weighted additions of the different color similarity factors and the same color similarity factors executed by varying a weighting ratio thereof based upon the results of the color evaluation; 2) a similarity judgment step in which levels of similarity manifesting along the individual directions are judged based upon the similarity factors; and 3) a second image generation step in which color information for the second image is generated by using the color information in the first image based upon judgment results obtained in the similarity judgment step. In this case, it is preferred that: in the similarity factor calculation step executed during the image conversion step, the different color similarity factors are mainly used as the similarity factors when a saturation level is judged to be low in the color evaluation, and the same color similarity factors are mainly used as the similarity factors if the saturation level is judged to be high in the color evaluation.

[0013] In the first image processing method, it is preferred that: the image conversion step includes a second image generation step in which color information for the second image is generated by using color information present at a pixel in the first image corresponding to the processing target pixel and color information present at nearby pixels in the first image with a make-up ratio of the color information adjusted in conformance to the results of the color evaluation. In this case, it is preferred that in the second image generation step executed during the image conversion step, the make-up ratio of the color information present at the pixel in the first image corresponding to the processing target pixel is raised if a saturation level is judged to be low in the color evaluation. Or it is preferred that: the image conversion step includes prior to the second image generation step 1) a similarity factor calculation step in which similarity factors along at least two directions are calculated for the processing target pixel by using the color information in the first image, and 2) a similarity judgment step in which levels of similarity manifesting along the individual directions are judged based upon the similarity factors for the processing target pixel; and the make-up ratio is adjusted based upon the results of the color evaluation only if judgment results obtained through the similarity judgment step indicate substantially equal levels of similarity manifesting along the individual directions.

[0014] In the first image processing method, it is preferred that the image conversion step includes: 1) a second image generation step in which color difference information for the second image is generated by using the color information in the first image; and 2) a color difference information correction step in which the color difference information for the second image is corrected based upon the results of the color evaluation. In this case, it is preferred that in the color difference information correction step executed during the image conversion step, wide range filter processing is executed on the color difference information for the second image when a saturation level is judged to be low in the color evaluation, and narrow range filter processing is executed on the color difference information for the second image when the saturation level is judged to be high in the color evaluation.

[0015] In the first image processing method, it is preferred that: 1) in color difference information generation step executed during the color judgment step, a plurality of types of color difference information are generated for a single processing target pixel; and 2) in the color evaluation step executed during the color judgment step, the color evaluation is executed by taking into consideration a new type of color difference information generated through a combination of the plurality of types of color difference information.

[0016] In the first image processing method, it is preferred that in the color evaluation step executed during the color judgment step, the color evaluation is executed by incorporating color difference information generated for nearby pixels through the color difference information generation step with the color difference information generated for the processing target pixel.

[0017] In the first image processing method, it is preferred that in the color evaluation step executed during the color judgment step, the color difference information is corrected and the color evaluation is executed by using the corrected color difference information. In this case, it is preferred that in the color evaluation step executed during the color judgment step, low-pass filter processing is executed to correct the color difference information.

[0018] In the first image processing method, it is preferred that: the color judgment step includes after the color evaluation step 1) a color difference information correction step in which the color difference information is corrected based upon the results of the color evaluation, and 2) a color re-evaluation step in which a color evaluation is re-executed in units of individual pixels by using the color difference information having been corrected through the color difference information correction step; and the first image is converted to the second image based upon results of the color evaluation executed in the color re-evaluation step. In this case, it is preferred that: the color judgment step includes prior to the color difference information correction step 1) a luminance information calculation step in which luminance information is calculated by using the color information in the first image, and 2) a luminance evaluation step in which a luminance evaluation is executed in units of individual pixels by using the luminance information; and in the color difference information correction step, the color difference information is corrected based upon the results of the color evaluation executed in the color re-evaluation step and results of the luminance evaluation executed in the luminance evaluation step. Also, it is preferred that it is preferred that in the color difference information correction step executed during the color judgment step, median filter processing is executed on the color difference information.

[0019] A second image processing method according to the present invention for converting a first image that is expressed in a calorimetric system made up of a plurality of color components and comprises a plurality of pixels each having color information corresponding to one of the color components into a second image that comprises a plurality of pixels each having a plurality of types of color information, comprises: an image acquisition step in which the first image is obtained; a color difference information generation step in which color difference information is generated in correspondence to positions of the pixels constituting the second image based upon color information corresponding to the color components of the obtained first image; a color evaluation step in which a color evaluation is executed in units of individual pixels by using the generated color difference information for the second image; a luminance information generation step in which luminance information is generated in correspondence to the positions of the pixels constituting the second image based upon results of the color evaluation executed in units of the individual pixels of the second image; and an output step in which the second image is output by using the color difference information generated in the color difference information generation step and the luminance information generated in the luminance information generation step.

[0020] In the second image processing method, it is preferred that: the color difference information at the position of a given pixel of the second image comprises a plurality of types of color difference information; and in the color evaluation step, the color evaluation is executed by taking into consideration a new type of color difference information generated through a combination of the plurality of types of color difference information. In this case, it is preferred that: the first image is expressed in a calorimetric system that is made up of a first color component, a second color component and a third color component, with pixels corresponding to the first color component set with a higher pixel density than pixels corresponding to the second color component or pixels corresponding to the third color component; the plurality of types of color difference information include first color difference information comprising a difference between color information corresponding to the first color component and color information corresponding to the second color component and second color difference information comprising a difference between the color information corresponding to the first color component and color information corresponding to the third color information; and the new type of color difference information comprises a difference between the first color difference information and the second color difference information.

[0021] In the second image processing method, it is preferred that in the color evaluation step, the generated color difference information for the second image is corrected and the color evaluation is executed by using the corrected color difference information. In this case, it is preferred that in the color evaluation step, the generated color difference information for the second image is corrected through low-pass filter processing.

[0022] In the second image processing method, it is preferred that there are further provided: a similarity factor calculation step executed before the luminance information generation step, in which different color similarity factors indicating similarity manifesting between a pixel of the first image corresponding to a pixel of the second image and nearby pixels along at least two directions are calculated by using color information corresponding to different color components in a local area containing the pixel and same color similarity factors indicating similarity manifesting between the pixel and nearby pixels along at least the two directions are calculated by using color information corresponding to a single color component in the local area containing the pixel; and a similarity judgment step executed before the luminance information generation step and after the color evaluation step, in which levels of similarity manifesting along at least the two directions between the pixel of the first image corresponding to the pixel of the second image and the nearby pixels are judged by selectively using either the different color similarity factors or the same color similarity factors calculated in the similarity factor calculation step based upon the results of the color evaluation, and in the luminance information generation step, the luminance information is generated in correspondence to the position of the pixel of the second image based upon judgment results obtained in the similarity judgment step.

[0023] In the second image processing method, it is preferred that the plurality of pixels of the first image and the plurality of pixels of the second image correspond to each other in a positional arrangement.

[0024] In the second image processing method, it is preferred that in the luminance information generation step, the luminance information is generated in correspondence to the position of a pixel of the second image by using color information at a pixel of the first image corresponding to the pixel of the second image and color information present at nearby pixels of the first image, and a make-up ratio of the color information present at the pixel of the first image corresponding to the pixel of the second image and the color information present at nearby pixels of the first image is adjusted based upon the results of the color evaluation executed in units of individual pixels constituting the second image.

[0025] In the second image processing method, it is preferred that: there is further provided a similarity judgment step executed before the color difference information generation step, in which levels of similarity manifesting between a pixel of the first image corresponding to a pixel of the second image and nearby pixels of the first image along at least two directions are judged by using color information present in a local area containing the pixel of the first image; and in the color difference information generation step, color difference information is generated in correspondence to a position of the pixel of the second image based upon judgment results obtained through the similarity judgment step. In this case, it is preferred that in the similarity judgment step, levels of similarity manifesting between the pixel of the first image corresponding to the pixel of the second image and the nearby pixels of the first image along at least two directions are judged by using color information corresponding to different color components present in the local area containing the pixel of the first image.

[0026] A third image processing method according to the present invention for converting a first image that is expressed in a colorimetric system made up of a plurality of color components and comprises a plurality of pixels each having color information corresponding to at least one of the color components into a second image that comprises a plurality of pixels each having at least a common type of color information that is not present in the first image, comprises: 1) a color difference information generation step in which color difference information is generated by using color information in the first image; 2) a color evaluation step in which a color evaluation is executed in units of individual pixels by using the color difference information; 3) a color difference information correction step in which the color difference information is corrected through a single type of correction selected from a plurality of types of correction based upon results of the color evaluation executed in the color evaluation step; and 4) an output step in which the second image is output by using the corrected color difference information, all executed for a processing target pixel in the second image.

[0027] In the third image processing method, it is preferred that: the plurality of types of correction include a first correction through which the color difference information that has been generated is corrected through wide-range low-pass filter processing and a second correction through which the color difference information that has been generated is corrected through narrow range low-pass filter processing; and in the color difference information correction step, the first correction is selected if the saturation level is judged to be low in the color evaluation and the second correction is selected if the saturation level is judged to be high in the color evaluation.

[0028] In the third image processing method, it is preferred that: the plurality of types of correction include a first correction through which the color difference information that has been generated is corrected through wide-range median filter processing and a second correction through which the color difference information that has been generated is corrected through narrow-range median filter processing; and in the color difference information correction step, the first correction is selected if a saturation level is judged to be low in the color evaluation and the second correction is selected if the saturation level is judged to be high in the color evaluation.

[0029] In the third image processing method, it is preferred that: the color difference information corresponding to a position of a given pixel of the second image comprises a plurality of types of color difference information; and in the color evaluation step, the color evaluation is executed by taking into consideration a new type of color difference information generated through a combination of the plurality of types of color difference information. In this case, it is preferred that: the first image is expressed in a calorimetric system that is made up of a first color component, a second color component and a third color component, with pixels corresponding to the first color component set with a higher pixel density than pixels corresponding to the second color component or pixels corresponding to the third color component; the plurality of types of color difference information include first color difference information comprising a difference between color information corresponding to the first color component and color information corresponding to the second color component and second color difference information comprising a difference between the color information corresponding to the first color component and color information corresponding to the third color information; and the new type of color difference information comprises a difference between the first color difference information and the second color difference information.

[0030] In the third image processing method, it is preferred that in the color evaluation step, the color evaluation is executed by incorporating color difference information generated for nearby pixels through the color difference information generation step with the color difference information generated for the processing target pixel.

[0031] In the third image processing method, it is preferred that in the color evaluation step executed during the color judgment step, the color difference information is corrected and the color evaluation is executed by using the corrected color difference information. In this case, it is preferred that in the color evaluation step executed during the color judgment step, low-pass filter processing is executed to correct the color difference information. Furthermore, it is preferred that the low-pass filter is a wide-range low-pass filter.

[0032] In the third image processing method, it is preferred that: there is further provided a similarity judgment step executed before the color difference information generation step, in which levels of similarity manifesting between a pixel of the first image corresponding to a pixel of the second image and nearby pixels of the first image along at least two directions are judged by using color information present in a local area containing the pixel of the first image; and in the color difference information generation step, color difference information is generated in correspondence to a position of the pixel of the second image based upon judgment results obtained through the similarity judgment step. In this case, it is preferred that: 1) in the similarity judgment step, the levels of similarity manifesting along the individual directions are each judged to be one of at least three different levels; and 2) in the color difference information generation step, the color difference information is generated by using the color information in the first image through one of at least three different methods each corresponding to specific judgment results obtained in the similarity judgment step.

[0033] A fourth image processing method according to the present invention for converting a first image that is expressed in a colorimetric system made up of a plurality of color components and comprises a plurality of pixels each having color information corresponding to at least one of the color components into a second image that comprises a plurality of pixels each having at least a common type of color information that is not present in the first image, comprises: 1) a luminance information generation step in which luminance information is generated by using color information in the first image; 2) a luminance evaluation step in which a luminance evaluation is executed in units of individual pixels by using the luminance information; 3) a second image generation step in which color information for the second image is generated by using the color information of the first image; and 4) a second image correction step in which the color information for the second image is corrected based upon results of the luminance evaluation executed in units of the individual pixels of the second image, and steps of 1) through 4) all are executed for a processing target pixel of the second image. In this case, it is preferred that in the luminance evaluation step, the luminance evaluation is executed by calculating a maximum value among values indicated in the luminance information of a plurality of pixels present within a local area containing the processing target pixel and a value representing a variance of the values indicated by the luminance information. Furthermore, it is preferred that: 1) in the luminance evaluation step, one of two decisions that are a decision that a condition in which the maximum value and the variance value of the values indicated by the luminance information are each equal to or greater than a predetermined value is satisfied and a decision that the condition is not satisfied, is made; and 2) in the second image correction step, the color information for the second image is corrected through one of two different types of correction selected in conformance to the decision made with regard to the condition, or the color information is corrected only if the condition is satisfied. Yet furthermore, it is preferred that in the second image correction step, wide range median filter processing is executed if the condition is determined to be satisfied in the luminance evaluation and narrow-range median filter processing is executed if the condition is determined not to be satisfied in the luminance evaluation, or median filter processing is executed only if the condition is determined to be satisfied.

[0034] An image processing program according to the present invention is used to execute the steps of the above image processing methods on a computer.

[0035] A computer-readable recording medium according to the present invention records the above image processing program.

[0036] An image processing apparatus according to the present invention comprises the above image processing program.

BRIEF DESCRIPTION OF THE DRAWINGS

[0037]FIG. 1 is a functional block diagram of an electronic camera that corresponds to first through ninth embodiments;

[0038]FIG. 2 shows the arrangement of the color components in the image data undergoing the interpolation processing;

[0039]FIG. 3 presents a flowchart of the operations executed in the image processing unit in the first embodiment;

[0040]FIG. 4 presents a flowchart of an operation executed in the image processing unit in the first embodiment;

[0041]FIG. 5 presents a flowchart of an operation executed in the image processing unit in the first embodiment;

[0042]FIG. 6 presents a flowchart of an operation executed in the image processing unit in the first embodiment;

[0043]FIG. 7 presents a flowchart of an operation executed in the image processing unit in the first embodiment;

[0044]FIG. 8 presents illustrations referred to in the explanation of the processing executed to generate an image used for color judgment;

[0045]FIG. 9 presents illustrations referred to in the explanation of the color index calculation;

[0046]FIG. 10 presents an illustration provided to facilitate an explanation of the color index;

[0047]FIG. 11 presents illustrations referred to in the explanation of the calculation of the same color similarity factors along the vertical and horizontal directions;

[0048]FIG. 12 presents another example of the similarity judgment processing that may be executed in the first embodiment;

[0049]FIG. 13 presents illustrations referred to in the explanation of the calculation of same color similarity factors along diagonal directions;

[0050]FIG. 14 shows directions along which a high degree of similarity manifests as indicated by the values of [HV,DN];

[0051]FIG. 15 presents a flowchart of an operation executed in the image processing unit in the second embodiment;

[0052]FIG. 16 shows the relationship between the color index and the luminance indices;

[0053]FIG. 17 illustrates the median filter ranges;

[0054]FIG. 18 presents another example of the interpolation value calculation processing that may be executed in the second embodiment;

[0055]FIG. 19 presents a flowchart of an operation executed in the image processing unit in the third embodiment;

[0056]FIG. 20 presents another example of the judgment processing that may be executed in the third embodiment;

[0057]FIG. 21 illustrates the concept of image data conversion;

[0058]FIG. 22 presents a schematic flowchart of the image data conversion processing executed in the image processing unit;

[0059]FIG. 23 is a block diagram provided to facilitate an explanation of the relationship among the various types of processing executed in the sixth embodiment;

[0060]FIG. 24 illustrates a wide-range low-pass filter;

[0061]FIG. 25 is a block diagram provided to facilitate and explanation of the relationship among the various types of processing executed in the seventh embodiment;

[0062]FIG. 26 shows the positions and the color components of the pixels used in correspondence to a specific directional index when the conversion target pixel is an R pixel;

[0063]FIG. 27 presents a schematic flowchart of the image data conversion processing executed in the image processing unit in the eighth embodiment;

[0064]FIG. 28 shows the positions and the coefficient (G-positioned luminance generation coefficient pattern) of the pixels used when the conversion target pixel is a G pixel;

[0065]FIG. 29 shows the positions and the coefficients (R-positioned or B-positioned luminance generation coefficient pattern) of the pixels used in correspondence to a specific directional index when the conversion target pixel is an R pixel or a B pixel;

[0066]FIG. 30 shows an edge enhancing filter;

[0067]FIG. 31 presents a schematic flowchart of the image data conversion processing executed in the image processing unit in the ninth embodiment;

[0068]FIG. 32 is a block diagram provided to facilitate an explanation of the relationship among the various types of processing executed in the ninth embodiment;

[0069]FIG. 33 shows a narrow range low-pass filter;

[0070]FIG. 34 summarizes the utilization of the color index obtained through the color evaluation in the sixth through ninth embodiments; and

[0071]FIG. 35 shows how the program may be provided in a recording medium such as a CD-ROM or through a data signal on the Internet or the like.

BEST MODE FOR CARRYING OUT THE INVENTION

[0072] The following is a detailed explanation of the embodiments of the present invention. An explanation is given in reference to the first through fourth embodiments on an example in which the image restoration or reconstruction processing executed in the image processing apparatus according to the present invention is adopted in an electronic camera equipped with an interpolation processing function.

[0073]FIG. 1 is a functional block diagram of the electronic camera corresponding to the first through fourth embodiments.

[0074] The electronic camera 1 includes an A/D conversion unit 10, an image processing unit 11, a control unit 12, a memory 13, a compression/decompression unit 14 and a display image generation unit 15. It also includes amemory card interface unit 17 for achieving an interface with a memory card (a card type removable memory) 16 and an external interface unit 19 for achieving an interface with an external apparatus such as a PC (personal computer) 18 via a specific cable or a wireless transmission path. These blocks are connected with one another via a bus 29. The image processing unit 11 may be constituted of, for instance, a one-chip microprocessor dedicated to image processing.

[0075] In addition, the electronic camera 1 is provided with a photographic optical system 20, an image-capturing sensor 21, an analog signal processing unit 22 and a timing control unit 23. The output of the image-capturing sensor 21, at which an optical image of a subject obtained at the photographic optical system 20 is formed, is connected to the analog signal processing unit 22. The output of the analog signal processing unit 22, in turn, is connected to the A/D conversion unit 10. The output of the control unit 12 is connected to the timing control unit 23 and the output of the timing control unit 23 is connected to the image-capturing sensor 21, the analog signal processing unit 22, the A/D conversion unit 10 and the image processing unit 11. The image-capturing sensor 21 maybe constituted of, for instance, a CCD.

[0076] The electronic camera 1 is further provided with an operation unit 24 that is equivalent to a shutter release button, a selector button for mode switching and the like, and a monitor 25. The output of the operation unit 24 is connected to the control unit 12, whereas the output of the display image generation unit 15 is connected to the monitor 25.

[0077] It is to be noted that an application program recorded in a CD-ROM 28 is pre-installed in the PC 18 which is connected with a monitor 26, a printer 27 and the like. In addition, the PC 18 includes a memory card interface unit (not shown) for achieving an interface with the memory card 16 and an external interface unit (not shown) for achieving an interface with an external apparatus such as the electronic camera 1 via a specific cable or a wireless transmission path, in addition to a CPU, a memory and a hard disk (none shown).

[0078] As the operator selects a photographing mode and presses the shutter release button via the operation unit 24 in the electronic camera 1 structured as shown in FIG. 1, the control unit 12 implements timing control for the image-capturing sensor 21, the analog signal processing unit 22 and the A/D conversion unit 10 via the timing control unit 23. The image-capturing sensor 21 generates image signals corresponding to the optical image. These image signals undergo a specific type of signal processing at the analog signal processing unit 22, are digitized at the A/D conversion unit 10 and are provided to the image processing unit 11 as image data.

[0079] Since R (red), G (green) and B (blue) color filters are arranged in a Bayer array at the image-capturing sensor 21 of the electronic camera 1, the image data are provided to the image processing unit 11 in the RGB colorimetric system. Color information corresponding to one of the three color components, R, G and B is present at each of the numerous pixels constituting the image data.

[0080] In addition to the image data conversion processing which is to be detailed later, the image processing unit 11 executes image processing such as gradation conversion and edge enhancement on the image data. After such image processing is completed, the image data undergo a specific type of compression processing at the compression/decompression unit 14 as necessary and then are recorded into the memory card 16 via the memory card interface unit 17.

[0081] It is to be noted that the image data having undergone the image processing may be recorded into the memory card 16 in an uncompressed state, or they may be converted to image 1o data to the calorimetric system adopted at the monitor 26 or the printer 27 connected to the PC 18 to be provided to the PC 18 via the external interface unit 19. In addition, if the operator selects a replay mode via the operation unit 24, the image data recorded in the memory card 16 are read out via the memory card interface unit 17, are decompressed at the compression/decompression unit 14 and are displayed at the monitor 25 via the display image generation unit 15.

[0082] It is to be noted that instead of displaying the decompressed image data at the monitor 25, the decompressed image data maybe converted to the colorimetric system adopted at the monitor 26 or the printer 27 connected to the PC 18 and may be provided to the PC 18 via the external interface unit 19. In addition, the processing for converting the image data having undergone the conversion processing to be detailed later into the colorimetric system adopted at the monitor 25 or 26 or the printer 27 may be achieved by adopting a technology in the known art.

[0083]FIG. 2 illustrates the arrangement of the color components of image data undergoing interpolation processing. It is to be noted that R, G and B indicate different color components and the positions of the pixels corresponding to the individual color components are indicated by using values of coordinates [x,y] in FIG. 2.

[0084] In the arithmetic expressions to be detailed later, R and B in FIG. 2 are replaced with Z and the color information corresponding to the color component at each pixel is expressed as Z[i,j].

FIRST EMBODIMENT

[0085]FIGS. 3 through 7 present flowcharts of operations executed in the image processing unit 11 in the first embodiment.

[0086] It is to be noted that FIGS. 3 through 7 show the flows of the operations executed in the interpolation processing which is part of the image processing executed by the image processing unit 11. FIG. 3 shows an overall flow of the interpolation processing operations, whereas FIGS. 4 through 7 respectively show operating flows of “color judgment image generation processing”, “color judgment processing”, “similarity judgment processing” and “interpolation value calculation processing” included in the interpolation processing.

[0087] In reference to the first embodiment, the operations of the interpolation processing which is part of the image processing executed by the image processing unit 11 are explained and an explanation of other operations is omitted.

[0088] First, the image processing unit 11 generates a “color judgment image” by executing the “color judgment image generation processing” in FIG. 4 (FIG. 3, S1).

[0089] It is to be noted that the “color judgment image”, which is an image used for the calculation of a “color index”, comprises the color hue values at a single pixel. The phrase “hue values at a single pixel” in this context refers to color hue values that are calculated independently for each pixel. In addition, the “color index” is an index indicating the characteristics of the color at each pixel, which is referenced when judging whether the pixel undergoing the interpolation processing constitutes a chromatic image portion or an achromatic image portion (hereafter referred to as “color judgment”) . Namely, the color judgment image is generated so as to enable an area classification of the colors of the image undergoing the interpolation in units of the individual pixels.

[0090] In the first embodiment, an image having color differences Cr and Cb (equivalent to the Cr component and the Cb component in the YCbCr calorimetric system; the color differences Cr and Cb are defined as Cr=R−G and Cb=B−G in this document) made to correspond to all the pixels is generated as the color judgment image. While the color judgment image generated for the purpose of color judgment is allowed to contain local color artifacts (false color) manifesting over several pixels, it is desirable to ensure that it does not include any color artifacts occurring in clusters due to periodic fine structures.

[0091] Accordingly, a judgment with regard to similarity is made by using “different color similarity factors” during the generation of the color differences Cr and Cb and during the interpolation processing so as to resolve an image area that is likely to manifest color artifacts in clusters by giving priority to the fine structure portion present in the image area and to faithfully reflect the characteristics of the color of the original image (the saturation level and the like) in the first embodiment. It is to be noted that a “different color similarity factor” refers to a similarity factor determined by using one or more similarity factor components constituted of color information representing different color components, which allows a judgment on similarity to be made over a pitch of 1 pixel.

Color Judgment Image Generation Processing

[0092] Now, in reference to FIG. 4, the “color judgment image generation processing” is explained.

[0093] First, the image processing unit 11 calculates different color similarity factors along the vertical direction and the horizontal direction for a pixel at which the green component is missing (FIG. 4, S1).

[0094] For instance, the image processing unit 11 calculates the values defined as in expression 1 and expression 2 below during the process of similarity factor calculation. GR (GB) similarity factor components

Cv 0 [i,j]=(|G[i,j−1]−Z[i,j]|+|G[i,j+1]−Z[i,j]|)/2   expression 1

Ch 0 [i,j]=(|G[i−1,j]−Z[i,j]|+|G[i+1,j]−Z[i,j]|)/2   expression 2

[0095] It is to be noted that if color information corresponding to the red color component is present at the coordinates [i,j] as in FIG. 2(a), the values of the similarity factor components are calculated by using the color information corresponding to the color components shown in FIG. 8(a) in expression 1 and expression 2.

[0096] In addition, in expression 1 and expression 2, each term inside the symbol representing an absolute value (hereafter referred to as a “similarity factor element”) is constituted of color information provided at two adjacent pixels. For this reason, the different color similarity factors, which contain more information related to localized similarity compared to values such as Sv2 and Sh2 disclosed in Japanese Patent No. 2931520 that are obtained by applying a low-pass filter to color information over a wide range, enable a more accurate similarity judgment for an Nyquist frequency fine image structure manifesting changes over a single pixel pitch.

[0097] It is to be noted that the similarity factor elements may be calculated as squares of the absolute values or other powers of the absolute values instead of as the absolute values of color differences.

[0098] Alternatively, the similarity factor elements may each have a make-up as expressed in the expressions presented below.

Cv 0 [i,j]=|−G[i,j−1]+2·Z[i,j]−G[i,j+1]|/2   expression 1′

Ch 0 [i,j]=|−G[i−1,j]+2·Z[i,j]−G[i+1,j]|/2   expression 2′

[0099] While the values calculated by using expressions 1 and 2 (or expressions 1′ and 2′) may be directly utilized as the different color similarity factor along the vertical direction and the different color similarity factor along the horizontal direction for the pixel at which the green color component is missing, similar values are calculated for pixels set around the target pixel as well as for the target pixel and the ultimate different color similarity factors along the vertical direction and the horizontal direction are calculated for the target pixel at which the green color component is missing through weighted addition of the individual values executed along each direction (hereafter referred to as “peripheral addition”) in this example.

[0100] Namely, based upon expressions 1 and 2 (or expressions 1′ and 2′), the image processing unit 11 executes an arithmetic operation for pixels positioned at the coordinates [i,j], [i−1, j−1], [i+1, j−1], [i−1, j+1], [i+1, j+1], [i,j−2], [i,j+2], [i−2,j] and [i+2,j], and then calculates a different color similarity factor Cv[i,j] along the vertical direction and a different color similarity factor Ch[i,j] along the horizontal direction through peripheral additions equivalent to those expressed in expressions 3 and 4 below executed by using the values obtained through the arithmetic operation. The operations expressed in expression 3 and expression 4 are equivalent to peripheral additions executed as shown in FIG. 8(b). It is to be noted that the method adopted for the peripheral addition is not limited to the example presented here.

[0101]Cv[i,j]=(4·Cv 0 [i,j]+2·(Cv 0 [i−1,j−1]+Cv 0 [i+1,j−1]+Cv 0 [i−1,j+1]Cv 0 [i+1,j+1])+Cv 0 [i,j−2]+Cv 0 [i,j+2]+Cv 0 [i−2,j]+Cv 0 [i+2,j])/16   expression 3

[0102]Ch[i,j]=(4·Ch 0 [i,j]+2·(Ch 0 [i−1,j−1]+Ch 0 [i+1,j−1]+Ch 0 [i−1,j+1]Ch 0 [i+1,j+1])+Ch 0 [i,j−2]+Ch 0 [i,j+2]+Ch 0 [i−2,j]+Ch 0 [i+2,j])/16   expression 4

[0103] It is to be noted that the similarity factors calculated through expressions 3 and 4 each indicate a higher degree of similarity as the value becomes smaller.

[0104] If color information corresponding to the red color component is present at the coordinates [i,j] as shown in FIG. 2(a), the operations expressed in expression 1 through expression 4 are executed by using the color information corresponding to the color components shown in FIG. 8(c).

[0105] Thus, the similarity factors obtained through the peripheral additions each contain similarity factor components each constituted of color information corresponding to the green color component and color information corresponding to the red color component and similarity factor components each constituted of color information corresponding to the green color component and color information corresponding to the blue color component. In other words, since the similarity factors are each calculated through peripheral addition by taking into consideration a plurality of color components and also taking into consideration continuity with surrounding pixels, the accuracy of the similarity factor is improved.

[0106] Next, the image processing unit 11 judges the similarity manifesting along the vertical direction and the horizontal direction (hereafter referred to as “vertical/horizontal similarity”) for the pixel at which the green component is missing, based upon the different color similarity factor Cv[i,j] along the vertical direction and the different color similarity factor Ch[i,j] along the horizontal direction (FIG. 4, S2). Then, the image processing unit 11 sets the appropriate value as described below for an index HV[i,j] which indicates the vertical/horizontal similarity as the results of the judgment.

[0107] For instance, if a condition expressed as

|Cv[i,j]−Ch[i,j]|≦Th0   condition 1

[0108] is satisfied with regard to an arbitrary threshold value Th0, the image processing unit 11 judges that “a high or low degree of similarity manifests along both the vertical direction and the horizontal direction” and sets 0 for the index HV[i,j]. If, on the other hand, condition 1 is not satisfied and, at the same time, a condition expressed as

Cv[i,j]<Ch[i,j]  condition 2

[0109] is satisfied, the image processing unit 11 judges that “a high degree of similarity manifests along the vertical direction” and sets “1” for the index HV[i,j]. If neither condition 1 or condition 2 is satisfied, the image processing unit 11 judges that “a high degree of similarity manifests along the horizontal direction” and sets “−1” for the index HV[i,j].

[0110] Next, the image processing unit 11 generates the color judgment image by generating color differences corresponding to the specific color components of the pixels at each of which color information corresponding to the red color component or color information corresponding to the blue color component is present, based upon the results of the judgment made with regard to the vertical/horizontal similarity and obtaining through interpolation the color differences corresponding to the missing color components for each pixel at which at least either color information corresponding to the red color component or color information corresponding to the blue color component is not present (FIG. 4, S3).

[0111] For instance, if a condition expressed as

HV[i,j]=1   condition 3

[0112] is satisfied with regard to the index HV[i,j] of a pixel at which color information corresponding to the red color component is present (if a high degree of similarity manifests along the vertical direction), the image processing unit 11 calculates the color difference Cr[i,j] for the pixel through expression 5 presented below.

Cr[i,j]=(2·Z[i,j]+Z[i,j−2]+Z[i,j+2])/4−(G[i,j−1]+G[i,j+1])/2   expression 5

[0113] If, on the other hand, condition 3 is not satisfied but a condition expressed as

HV[i,j]=−1   condition 4

[0114] is satisfied (if a high degree of similarity manifests along the horizontal direction) with regard to the index HV[i,j] of the pixel at which color information corresponding to the red color component is present, the image processing unit 11 calculates the color difference Cr[i,j] of the pixel through expression 6 presented below.

Cr[i,j]=(2·Z[i,j]+Z[i−2,j]+Z[i+2,j])/4−(G[i−1,j]+G[i+1,j])/2   expression 6

[0115] If neither condition 3 nor condition 4 is satisfied (a high degree of similarity or a low degree of similarity manifests along both the vertical direction and the horizontal direction) with regard to the index HV[i,j] of the pixel at which color information corresponding to the red color component is present, the image processing unit 11 calculates the color difference Cr[i,j] of the pixel through expression 7 presented below.

Cr[i,j]=(4·Z[i,j]+Z[i,j−2]+Z[i,j+2]+Z[i−2,j]+Z[i+2,j])/8−(G[i,j−1]+G[i,j+1]+G[i−1,j]+G[i+1,j])/4   expression 7

[0116] It is to be noted that the image processing unit 11 calculates the color difference Cb[i,j] for each pixel at which color information corresponding to the blue component is present through an operation similar to that expressed in one of expressions 5 through 7.

[0117] In addition, during the process of calculating color differences for pixels at each of which either color information corresponding to the red color component or color information corresponding to the blue color component is present as described above, the image processing unit 11 sets “0” for initialization for the color difference at pixels with no color information representing the corresponding color components.

[0118] Next, the image processing unit 11 obtains through interpolation the color difference (Cr[i,j] or Cb[i,j]) corresponding to the specific missing color component for each of the pixels at which color information corresponding to the red color component or color information corresponding to the blue color component is missing. While this interpolation is normally achieved through a method in which the average of color differences at adjacent pixels is used as an interpolation value, a method in which a low-pass filter is applied to all the pixels as well as calculating interpolation values is adopted in this example so as to reduce the extent of color artifacts due to color moire that manifests in an image having a periodic structure.

[0119] For instance; the image processing unit 11 calculates the color difference Cr[i,j] corresponding to the red color component through expression 8 presented below. It is to be noted that the operation expressed in expression 8 is equivalent to execute a weighted addition of color difference values Cr at the individual pixels as shown in FIG. 8(d).

[0120]Cr[i,j]=(36·Cr[i,j]+24·(Cr[i−1,j]+Cr[i+1,j]+Cr[i,j−1]+Cr[i,j+1])+16·(Cr[i−1,j−1]+Cr[i+1,j−1]+Cr[i−1,j+1]+Cr[i+1,j+1])+6·(Cr[i−2,j]+Cr[i+2,j]+Cr[i,j−2]+Cr[i,j+2])+4·(Cr[i−1,j−2]+Cr[i+1,j−2]+Cr[i−2,j−1]+Cr[i+2,j−1]+Cr[i−2,j+1]+Cr[i+2,j+1]+Cr[i−1,j+2]+Cr[i+1,j+2])+1·(Cr[i−2,j−2]+Cr[i+2,j−2]+Cr[i−2,j+2]+Cr[i+2,j+2]))/64   expression 8

[0121] In addition, the image processing unit 11 also calculates color difference Cb[i,j] through an operation similar to that expressed in expression 8.

[0122] Once the “color judgment image generation processing” is completed as explained above, the image processing unit 11 executes the “color judgment processing” shown in FIG. 5 (FIG. 3, S2).

Color Judgment Processing

[0123] The “color judgment processing” is now explained in reference to FIG. 5.

[0124] First, the image processing unit 11 calculates a color index constituted of the color differences at the same pixel, as indicated below, by using the color judgment image generated through the “color judgment image generation processing” (FIG. 5, S1).

[0125] Namely, the image processing unit 11 calculates a color index Cdiff0[i,j] through expression 10 presented below.

Cdiff 0 [i,j]=(|Cr[i,j]|+|Cb[i,j]|+|Cr[i,j]−Cb[i,j]|)/3   expression 10

[0126] Unlike the color level disclosed in Japanese Patent No. 2931520, the color index in the first embodiment can be regarded as a value calculated by using the hue values within the same pixel.

[0127] As a result, by using the color index achieved in the first embodiment, which eliminates structural factors of the image reflected in the color level in the related art, a color judgment closer to human visual perception can be realized. In addition, since the color index achieved in the first embodiment is calculated by taking into consideration the color difference between R and B, unlike in the related art, the risk of an erroneous judgment that the pixel constitutes an achromatic image portion being made due to a large color difference between R and B is eliminated to enable a highly reliable color judgment.

[0128] While Cdiff0[i,j] calculated through expression 10 may be directly used as the color index for the pixel positioned at the coordinates [i,j], the color index Cdiff[i,j] for the pixel at the coordinates [i,j] is calculated through a peripheral addition in this example.

[0129] Namely, the image processing unit 11 executes an arithmetic operation for the pixels positioned at the coordinates [i,j], [i−1,j−2], [i+2,j−2], [i−2,j+2], [i+2,j+2], [i,j−4], [i,j+4], [i−4,j] and [i+4,j] by using expression 10 and calculates the color index Cdiff[i,j] through a peripheral addition equivalent to that expressed in expression 11 below of the values obtained through the arithmetic operation.

[0130] Cdiff[i,j]=(8·Cdiff 0 [i,j]+Cdiff 0 [i−2,j−2]+Cdiff 0 [i+2,j−2]+Cdiff 0 [i−2,j+2]+Cdiff 0 [i+2,j+2]+Cdiff 0 [i,j−4]+Cdiff 0 [i,j+4]+Cdiff 0 [i−4,j]+Cdiff 0 [i+4,j])/16   expression 11

[0131] It is to be noted that while the operation expressed in expression 11 is equivalent to executing a peripheral addition as indicated in FIG. 9(a), it may be calculated through a peripheral addition of Cdiff0 as indicated in FIG. 9(b) or FIG. 9(c).

[0132] By calculating the color index through the peripheral addition as described above, the adverse effect of color artifacts resulting from a local error having occurred in the color difference interpolation during the process of color judgment image generation can be reduced.

[0133] In addition, the peripheral addition is executed by using values calculated for pixels over a wide range and color moire components corresponding to colors complementary to each other are canceled out so as to reduce the adverse effect of color moire manifesting over long cycles of, for instance, 10 pixels, thereby improving the reliability of the color index.

[0134] After calculating the color indices Cdiff for the individual pixels as explained above, the image processing unit 11 executes a color judgment based upon the color indices Cdiff (FIG. 5, S2).

[0135] It is to be noted that in the first embodiment, processing for classifying each pixel into one of four groups (a fully achromatic portion, an achromatic portion, a lightly saturated (chromatic) portion and a saturated (chromatic) portion) based upon the level of the color index of the pixel through color judgment is executed. It is also to be noted that the values taken for threshold values ThBWz, ThBWa and ThBWb used in conditional expressions 10 through 12 below are each respectively set to 2, 5 and 10 through 15 when the color index Cdiff[i,j] indicates gradations within the range of 0 through 255.

[0136] If the color index Cdiff[i,j] of a given pixel satisfies a condition expressed as

Cdiff[i,j]≦ThBWz   condition 10

[0137] the image processing unit 11 judges that the pixel is a fully achromatic portion and accordingly sets “z” for a color classification index BW[i,j] which indicates the results of the color judgment. If, on the other hand, condition 10 is not satisfied and, at the same time, the color index of the pixel satisfies a condition expressed as

Cdiff[i,j]≦ThBWa   condition 11

[0138] the image processing unit 11 judges that the pixel is an achromatic portion and sets “a” for the color classification index BW[i,j]. If neither condition 10 nor condition 11 is satisfied but the color index satisfies a condition expressed as

Cdiff[i,j]≦ThBWb   condition 12

[0139] the image processing unit 11 judges that the pixel is a lightly saturated portion and sets “b” for the color classification index BW[i,j]. If none of the conditions 10 through 12 are satisfied, the image processing unit 11 judges that the pixel is a saturated portion and set “c” for the color classification index BW[i,j].

[0140]FIG. 10 presents charts that facilitate the explanation of the color index, and FIG. 10(a) in particular shows the relationship between the color index and the color classification index.

[0141] Once the “color judgment processing” is completed as explained above, the image processing unit 11 executes the “similarity judgment processing” shown in FIG. 6 (FIG. 3, S3).

Similarity Judgment Processing

[0142] In reference to FIG. 6, the “similarity judgment processing” is explained.

[0143] In the “similarity judgment processing”, the similarity manifesting at each pixel at which the green color component is missing is judged based upon different color similarity factors (similarity factors each constituted of sets of color information representing different color components) and same color similarity factors (similarity factors each constituted of sets of color information representing a single color component). It is to be noted that the different color similarity factors have been calculated in the “color judgment image generation processing”, whereas the same color similarity factors are newly defined here by using different expressions. Since the different color similarity factors are calculated by disregarding the specific color components of the individual pixels and the same color similarity factors are calculated by taking into consideration the specific color component corresponding to the individual pixels, it is desirable to use either the different color similarity factors or the same color similarity factors depending upon the value indicated by the color index or the color classification index. Through experiment, it has been confirmed that the different color similarity factors are more suited for judging the degree of vertical/horizontal similarity manifesting at a pixel which is either an achromatic image portion or a fully achromatic image portion, whereas the same color similarity factors are more suited for judging the degree of vertical/horizontal similarity manifesting at a pixel that is part of a lightly saturated image area or a saturated image area.

[0144] Accordingly, the judgment on the vertical/horizontal similarity manifesting at a pixel constituting part of an achromatic image area or a fully achromatic image area is executed by using the direct results of the judgment on the vertical/horizontal similarity obtained through the “color judgment image generation processing” in the first embodiment.

[0145] First, the image processing unit 11 verifies the results of the “color judgment processing” executed on the pixels at which the green color component is missing (FIG. 6, S1).

[0146] Then, the image processing unit 11 calculates same color similarity factors (similarity factors each calculated by using one or more similarity factor components constituted of color information corresponding to a single color component) along the vertical direction and the horizontal direction for each of pixels classified as lightly saturated image portions or saturated image portions (each pixel for which either “b” or “c” is set in the color classification index thereof) among the pixels at which the green color component is missing (FIG. 6, S2), and re-judges the vertical/horizontal similarity by using the same color similarity factors (FIG. 6, S3).

[0147] Namely, the image processing unit 11 calculates values defined in expressions 20 through 23 for each pixel having been classified as a lightly saturated image portion or a saturated image portion.

G-G Similarity Factor Components

Cvs 1 [i,j]=|G[i,j−1]−G[i,j+1]|  expression 20

Chs 1 [i,j]=|G[i−1,j]−G[i+1,j]|  expression 21

B-B (R-R) Similarity Factor Components

Cvs 2 [i,j]=(|Z[i−1,j−1]−Z[i−1,j+1]|

[0148] +|Z[i+1,j−1]−Z[i+1,j+1]|)/2   expression 22

[0149]Chs 2 [i,j]=(|Z[i−1,j−1]−Z[i+1,j−1]|+|Z[i−1,j+1]−Z[i+1,j+1]|)/2   expression 23

[0150] It is to be noted that if color information corresponding to the red color component is present at the pixel positioned at the coordinates [i,j] as shown in FIG. 2(a), the values are calculated through expressions 20 and 21 by using the color information corresponding to the color component shown in FIG. 11(a), and the values are calculated through expressions 22 and 23 by using color information corresponding to the color component shown in FIG. 11(b).

[0151] Alternatively, the values of Cvs2[i,j] and Chs2[i,j] may be calculated as indicated below.

R-R(B-B) Similarity Factor Components

Cv 2 [i,j]=(|Z[i,j−2]−Z[i,j]|+|Z[i,j+2]−Z[i,j]|)/2   

[0152] expression 22′

Ch 2 [i,j]=(|Z[i−2,j]−Z[i,j]|+|Z[i+2,j]−Z[i,j]|)/2   expression 23′

Cv 2 [i,j]=|−Z[i,j−2]+2·Z[i,j]−Z[i,j+2]|/2   expression 22″

Ch 2 [i,j]=|−Z[i−2,j]+2·Z[i,j]−Z[i+2,j]|/2   expression 23″

[0153] If color information corresponding to the red color component is present at the pixel positioned at the coordinates [i,j] as shown in FIG. 2(a), the values are calculated through expressions 22′ and 23′ or expressions 22″ and 23″ by using the color information corresponding to color component shown in FIG. 11(c).

[0154] Next, the image processing unit 11 calculates values defined in expressions 24 and 25 presented below. Namely, the image processing unit 11 executes weighted addition of the values calculated through expressions 20 and 22 (or expression 22′ or expression 22″) and also executes a weighted addition of the values calculated through expressions 21 and 23 (or expression 21′ or expression 23″).

Cvs 0 [i,j]=(Cvs 1 +Cvs 2)/2   expression 24

Chs 0 [i,j]=(Chs 1 +Chs 2)/2   expression 25

[0155] It is to be noted that while the ratio used in the weighted additions is 1:1 in expressions 24 and 25, a ratio other than 1:1 may be used.

[0156] While the values calculated by using expressions 20 through 25 may be directly used as the same color similarity factors along the vertical direction and the horizontal direction of a “pixel classified as a lightly saturated image portion or a saturated image portion, at which color information corresponding to the green color component is not present”, the same color similarity factor along the vertical direction and the same color similarity factor along the horizontal direction are calculated through peripheral additions in this example.

[0157] Namely, the image processing unit 11 executes an arithmetic operation for the pixels positioned at the coordinates [i,j], [i−1],j−1], [i+1,j−1], [i−1,j+1], [i+1,j+1], [i,j−1], [i,j+2], [i−1,j] and [i+2,j] by using expressions 20 through 25 and calculates a same color similarity factor Cvs[i,j] along the vertical direction and a same color similarity factor Chs[i,j] along the horizontal direction through peripheral additions equivalent to the operations expressed in expressions 26 and 27 below by using the values obtained through the arithmetic operation. The operations expressed in expressions 26 and 27 are equivalent to executing peripheral additions as indicated in FIG. 11(d). It is to be noted that the method adopted to execute the peripheral additions is not limited to the example presented here.

[0158]Cvs[i,j]=(4·Cvs 0 [i,j]+2·(Cvs 0 [i−1,j−1]+Cvs 0 [i+1,j−1]

[0159] +Cvs0 [i−1,j+1]+Cvs 0 [i+1,j+1])+Cvs 0 [i,j−2]+Cvs 0 [i,j+2]+Cvs 0 [i−2,j]+Cvs 0 [i+2,j])/16   expression 26

[0160]Chs[i,j]=(4·Chs 0 [i,j]+2·(Chs 0 [i−1,j−1]+Chs 0 [i+1,j−1]+Chs 0 [i−1,j+1]+Chs 0 [i+1,j+1])+Chs 0 [i,j−2]+Chs 0 [i,j+2]+Chs 0 [i−2,j]+Chs 0 [i+2,j])/16   expression 27

[0161] The similarity factors calculated through expressions 26 and 27 each indicate a higher degree of similarity as the value of the similarity factor becomes smaller.

[0162] It is to be noted that if color information corresponding to the red color component is present at the pixel positioned at the coordinates [i,j] as shown in FIG. 2(a), the values are calculated through expressions 26 and 27 by using the color information corresponding to the color components shown in FIGS. 11(e) and 11(f).

[0163] Thus, the similarity factors obtained through the peripheral additions each contain a similarity factor component constituted entirely of color information corresponding to the green color component, a similarity factor component constituted entirely of color information corresponding to the blue color component and a similarity factor component constituted entirely of color information corresponding to the red color component. In other words, the similarity factors calculated through the peripheral additions by taking into consideration the plurality of color components and also the continuity with the surrounding pixels achieve a higher degree of accuracy of similarity.

[0164] Next, the image processing unit 11 makes another judgment on the vertical/horizontal similarity manifesting at the “pixel classified as a lightly saturated image portion or a saturated image portion, at which color information corresponding to the green color component is not present” based upon the same color similarity factor Cvs[i,j] along the vertical direction and the same color similarity factor Chs[i,j] along the horizontal direction and resets the index HV[i,j] that indicates the vertical/horizontal similarity.

[0165] For instance, if a condition expressed as

|Cvs[i,j]−Chs[i,j]|≦Th0   condition 20

[0166] is satisfied with regard to an arbitrary threshold value Th0, the image processing unit 11 judges that “a high or low degree of similarity manifests along both the vertical direction and the horizontal direction” and sets 0 for the index HV[i,j]. If, on the other hand, condition 20 is not satisfied and, at the same time, a condition expressed as

Cvs[i,j]<Chs[i,j]  condition 21

[0167] is satisfied, the image processing unit 11 judges that “a high degree of similarity manifests along the vertical direction” and sets “1” for the index HV[i,j]. If neither condition 20 nor condition 21 is satisfied, the image processing unit 11 judges that “a high degree of similarity manifests along the horizontal direction” and sets “−1” for the index HV[i,j].

[0168] When the processing explained above is completed, a value corresponding to the same color similarity factors is set for the index HV[i,j] for each “pixel classified as a lightly saturated image portion or a saturated image portion, at which color information corresponding to the green color component is not present”, whereas the value corresponding to the different color similarity factors is set for the index HV[i,j] for each “pixel classified as an achromatic image portion or a fully achromatic image portion, at which color information corresponding to the green color component is not present”.

[0169] In other words, the index HV[i,j] is calculated for a given pixel by using either the different color similarity factors or the same color similarity factors depending upon the value of the color index Cdiff[i,j] and the color classification index BW[i,j], as shown in FIG. 10(b).

[0170] It is to be noted that the similarity factors used to calculate the index HV[i,j] do not need to be of a single type, i.e., the different color similarity factors or the same color similarity factors. For instance, instead of the “similarity judgment processing” in FIG. 6, the “similarity judgment processing” shown in FIG. 12 maybe executed to judge the vertical/horizontal similarity by using similarity factors obtained through weighted additions of the different color similarity factors and the same color similarity factors.

[0171] In FIG. 12, before judging the results of the “color judgment processing”, same color similarity factors along the vertical direction and the horizontal direction are calculated (FIG. 12, S1). Then, for each pixel classified as an achromatic image portion or a fully achromatic image portion through the “color judgment processing”, similarity factors are calculated through weighted additions of the different color similarity factors and the same color similarity factors executed by raising the weighting ratio for the different color similarity factors calculated in FIG. 4, S1 (FIG. 12, S3). For each pixel classified as a lightly saturated image portion or a saturated image portion, on the other hand, similarity factors are calculated through weighted additions of the different color similarity factors and the same color similarity factors executed by raising the weighting ratio for the different color similarity factors (FIG. 12, S4). Then, the vertical/horizontal similarity is judged by using the similarity factors thus calculated (FIG. 12, S5).

[0172] It is to be noted that if the ratio of the weighting coefficients for the different color similarity factors and the same color similarity factors is set to 1:0 in FIG. 12, S3 and is also set to 0:1 in FIG. 12, S4, the results of the judgment made on the vertical/horizontal similarity are exactly the same as the results of the “similarity judgment processing” shown in FIG. 6.

[0173] Next, the image processing unit 11 calculates similarity factors (each constituted of a different color similarity factor and same color similarity factors) along a diagonal 45° direction and a diagonal 135° direction for each of the pixels at which the green color component is missing (FIG. 6, S4).

[0174] For instance, the image processing unit 11 may calculate values defined in expressions 30 through 35 presented below during the process of calculating the similarity factors.

R-B (B-R) Similarity Factor Components

[0175]C 45 _(—)1[i,j]=(|Z[i+1,j−1]−Z[i,j]|+|Z[i−1,j+1]−Z[i,j]|)/2   expression 30

[0176]C 135 _(—)1[i,j]=(|Z[i−1,j−1]−Z[i,j]|+|Z[i+1,j+1]−Z[i,j]|)/2   expression 31

G-G Similarity Factor Components

[0177]C 45 _(—)2[i,j]=(|G[i,j−1]−G[i−1,j]|+|G[i+1,j]−G[i,j+1]|)/2   expression 32

[0178]C 135 _(—)2[i,j]=(|G[i,j−1]−G[i+1,j]|+|G[i−1,j]−G[i,j+1]|)/2   expression 33

B-B (R-R) Similarity Factor Components

[0179]C 45 _(—)3[i,j]=|Z[i+1,j−1]−Z[i−1,j+1]|  expression 34

[0180]C 135 _(—)3[i,j]=(|Z[i−1,j−1]−Z[i+1,j+1]|  expression 35

[0181] It is to be noted that if color information corresponding to the red color component is present at the pixel positioned at the coordinates [i,j] as shown in FIG. 2(a), the values are calculated through expressions 30 and 31 by using the color information corresponding to the color components shown in FIG. 13(a), the values are calculated through expressions 32 and 33 by using the color information corresponding to the color component shown in FIG. 13(b) and the values are calculated through expressions 34 and 35 by using the color information corresponding to the color components shown in FIG. 13(c).

[0182] Alternatively, C45 _(—)3[i,j] and C135 _(—)3[i,j] may be calculated as indicated below.

RR(BB) Similarity Factor Components

[0183]C 45 _(—)3[i,j]=(|Z[i−1,j−2]−Z[i,j]|+|Z[i+2,j+2]−Z[i,j]|)/2   expression 34′C 135 _(—)3[i,j]=(|Z[i−1,j−1]−Z[i,j]|+|Z[i+2,j+2]−Z[i,j]|)/2   expression 35′

[0184]C 45 _(—)3[i,j]=|−Z[i−2,j−2]+2·Z[i,j]−Z[i+2,j+2]|/2   expression 34″

C 135 _(—)3[i,j]=|−Z[i−2,j−2]+2·Z[i,j]−Z[i+2,j+2]|/2   expression 35″

[0185] If color information corresponding to the red color component is present at the pixel positioned at the coordinates [i,j] as shown in FIG. 2(a), the values are calculated through expressions 34′ and 35′ and expressions 34″ and 35″ by using the color information corresponding to the color component shown in FIG. 13(d).

[0186] Next, the image processing unit 11 calculates the values defined in expressions 36 and 37 presented below. Namely, the image processing unit 11 executes a weighted addition of the values calculated by using expression 30, expression 32 and expression 34 (or expression 34′ or expression 34″) and also executes a weighted addition of the values calculated by using expression 31, expression 33 and expression 35 (or expressions 35′ or expressions 35″).

C 45 _(—)0[i,j]=(B1·C 45 _(—)1+B2·C 45 _(—)2+B3·C 45 _(—)3)/(B1+B2+B3)   expression 36

C 135 _(—)0[i,j]=(B1·C 135 _(—)1+B2·C 135 _(—)2+B3·C 135 _(—)3)/(B1+B2+B3)   expression 37

[0187] It is to be noted that the ratio set for the weighted additions executed as indicated in expressions 36 and 37 may be, for instance, “B1:B2:B3=2:2:1”

[0188] While the values calculated by using expressions 30 through 37 maybe directly used as the similarity factor along the diagonal 45° direction and the similarity factor along the diagonal 135° direction for the pixel at which color information corresponding to the green color component is missing, the diagonal 45° similarity factor and the diagonal 135° similarity factor are calculated through peripheral additions in this example.

[0189] Namely, the image processing unit 11 executes an arithmetic operation for the pixels positioned at the coordinates [i,j], [i−1,j−1], [i+1,j−1], [i−1,j+1], [i+1,j+1], (i,j−1], [i,j+2], [i−1,j] and [i+2,j] by using expressions 30 through 37 and calculates the similarity factor C45[i,j] along the diagonal 45° direction and the diagonal similarity factor C135[i,j] along the diagonal 135° direction through peripheral additions equivalent to the operations expressed in expressions 38 and 39 below by using the values obtained through the arithmetic operation. The operations expressed in expressions 38 and 39 are equivalent to executing peripheral additions as indicated in FIG. 13(e). It is to be noted that the method adopted to execute the peripheral additions is not limited to the example presented here.

[0190]C 45 [i,j]=(4·C 45 _(—)0[i,j]+2·(C 45 _(—)0[i−1,j−1]+C 45 _(—)0[i+1,j−1]+C 45 _(—)0[i−1,j+1]+C 45 _(—)0[i+1,j+1])+C 45 _(—)0[i,j−2]+C 45 _(—)0[i,j+2]+C 45 _(—)0[i−2,j]+C 45 _(—)0[i+2,j]))/16   expression 38

[0191]C 135 [i,j]=(4·C 135 _(—)0[i,j]+2·(C 135 _(—)0[i−1,j−1]+C 135 _(—)0[i+1,j−1]+C 135 _(—)0[i−1,j+1]+C 135 _(—)0[i+1,j+1])+C 135 _(—)0[i,j−2]+C 135 _(—)0[i,j+2]+C 145 _(—)0[i−2,j]+C 135 _(—)0[i+2,j]))/16   expression 39

[0192] The similarity factors calculated through expressions 38 and 39 each indicate a higher degree of similarity as the value of the similarity factor becomes smaller.

[0193] It is to be noted that if color information corresponding to the red color component is present at the pixel positioned at the coordinates [i,j] as shown in FIG. 2(a), the values are calculated through expressions 38 and 39 by using the color information corresponding to the color components shown in FIGS. 13(f) and 13(g).

[0194] Thus, the similarity factors obtained through the peripheral additions each contain a similarity factor component constituted of color information corresponding to the blue color component and color information corresponding to the red color component, a similarity factor component constituted entirely of color information corresponding to the green color component, a similarity factor component constituted entirely of color information corresponding to the blue color component and a similarity factor component constituted entirely of color information corresponding to the red color component. In other words, the similarity factors calculated through the peripheral additions by taking into consideration a plurality of color components and also the continuity with the surrounding pixels achieve a higher degree of accuracy.

[0195] Next, the image processing unit 11 judges the similarity manifesting along the diagonal directions at each pixel at which the green color component is missing (hereafter referred to as “diagonal similarity”) based upon the diagonal 45° similarity factor C45[i,j] and the diagonal 135° similarity factor C135[i,j] (FIG. 6, S5) . Then, the image processing unit 11 sets one of the following values for an index DN[i,j] indicating the diagonal similarity based upon the results of the judgment.

[0196] For instance, if a condition expressed as

|C 45 [i,j]−C 135 [i,j]|≦Th2   condition 30

[0197] is satisfied with regard to an arbitrary threshold value Th2, the image processing unit 11 judges that “a high or low degree of similarity manifests along both the diagonal 45° direction and the diagonal 135° direction” and sets “0” for the index DN[i,j]. If, on the other hand, condition 30 is not satisfied and, at the same time, a condition expressed as

C45[i,j]<C135[i,j]  condition 31

[0198] is satisfied, the image processing unit 11 judges that “a high degree of similarity manifests along the diagonal 45° direction” and sets “1” for the index DN[i,j]. If neither condition 30 nor condition 31 is satisfied, the image processing unit 11 judges that “a high degree of similarity manifests along the diagonal 135° direction and it sets “−1” for the index DN[i,j].

[0199] It is to be noted that while the diagonal similarity is judged by executing weighted additions of different color similarity factors and same color similarity factors in the first embodiment, the diagonal similarity may be judged instead by selectively using either the different color similarity factors or the same color similarity factors as in the judgment executed with regard to the vertical/horizontal similarity.

[0200] After the “similarity judgment processing” explained above is completed, the image processing unit 11 executes the “interpolation value calculation processing” shown in FIG. 7 (FIG. 3, S4).

Interpolation Value Calculation Processing

[0201] Now, in reference to FIG. 7, the “interpolation value calculation processing” is explained.

[0202] First, the image processing unit 11 calculates a G interpolation value (an interpolation value for the green color component) based upon the vertical/horizontal similarity and the diagonal similarity (FIG. 7, S1). Namely, the image processing unit 11 calculates the G interpolation value in correspondence to the index HV[i,j] indicating the vertical/horizontal similarity and the index DN[i,j] indicating the diagonal similarity set as explained earlier.

[0203] It is to be noted that while the G interpolation value may be calculated as in the related art, a phenomenon in which the average term of the green color component is over-corrected by the term of another color component (the same color component as that at the pixel undergoing the interpolation processing) occurs (hereafter referred to as “over-correction”) in such a calculation of the G interpolation value if it cannot be assumed that the color differences are constant or if there is a chromatic aberration. Accordingly, in the first embodiment, the G interpolation value is calculated while minimizing such an over-correction.

[0204] First, the image processing unit 11 ascertains the values of the index HV[i,j] indicating the vertical/horizontal similarity and the index DN[i,j] indicating the diagonal similarity, and classifies the specific intensity of the similarity manifesting at the pixel undergoing the interpolation processing as one of cases 1 through 9 below.

[0205] case 1: (HV[i,j],DN[i,j])=(1,1): marked similarity manifests along the vertical direction and the diagonal 45° direction

[0206] case 2: (HV[i,j],DN[i,j])=(1,0): marked similarity manifests along the vertical direction

[0207] case 3: (HV[i,j],DN[i,j])=(1,−1): marked similarity manifests along the vertical direction and the diagonal 135° direction

[0208] case 4: (HV[i,j],DN[i,j])=(0,1): marked similarity manifests along the diagonal 45° direction

[0209] case 5: (HV[i,j],DN[i,j])=(0,0): marked similarity manifests along all directions or only a low degree of similarity manifests in all directions (a specific direction along which marked similarity manifests cannot be ascertained)

[0210] case 6: (HV[i,j],DN[i,j])=(0,−1): marked similarity manifests along the diagonal 135° direction

[0211] case 7: (HV[i,j],DN[i,j])=(−1,1): marked similarity manifests along the horizontal direction and the diagonal 45° direction

[0212] case 8: (HV[i,j],DN[i,j])=(−1,0): marked similarity manifests along the horizontal direction

[0213] case 9: (HV[i,j],DN[i,j])=(−1,−1): marked similarity manifests along the horizontal direction and the diagonal 135° direction

[0214]FIG. 14 shows directions along which marked similarity manifests, each corresponding to a specific set of values set for HV[i,j]0 and DN[i,j].

[0215] Next, the G interpolation value G[i,j] is calculated as indicated below, based upon the results of the judgment described above.

In case 1: G[i,j]=Gv45   expression 40

In case 2: G[i,j]=Gv   expression 41

In case 3: G[i,j]=Gv135   expression 42

In case 4: G[i,j]=(Gv 45 +Gh 45)/2   expression 43

[0216] In case 5: G[i,j]=(Gv+Gh)/2   expression 44

[0217] In case 6: G[i,j]=(Gv 135+Gh 135)/2   expression 45

[0218] In case 7: G[i,j]=Gh45   expression 46

[0219] In case 8: G[i,j]=Gh   expression 47

[0220] In case 9: G[i,j]=Gh135   expression 48

[0221] with

[0222]Gv=(G[i,j−1]+G[i,j+1])/2+(2·Z[i,j]−Z[i,j−2]−Z[i,j+2])/8+(2·G[i−1,j]−G[i−1,j−2]−G[i−1,j+2]+2·G[i+1,j]−G[i+1,j−2]−G[i+1,j+2])/16   expression 50

[0223]Gv 45=(G[i,j−1]+G[i,j+1])/2+(2·Z[i,j]−Z[i,j−2]−Z[i,j+2])/8+(2·Z[i−1,j+1]−Z[i−1,j−1]−Z[i−1,j+3]+2·Z[i+1,j−1]−Z[i+1,j−3]−Z[i+1,j+1])/16   expression 51

[0224]Gv 135=(G[i,j−1]+G[i,j+1])/2+(2·Z[i,j]−Z[i,j−2]−Z[i,j+2])/8+(2·Z[i−1,j−1]−Z[i−1,j−3]−Z[i−1,j+1]+2·Z[i+1,j+1]−Z[i+1,j−1]−Z[i+1,j+3])/16   expression 52

[0225]Gh=(G[i−1,j]+G[i+1,j])/2+(2·Z[i,j]−Z[i−2,j]−Z[i+2,j])/8+(2·G[i,j−1]−G[i−2,j−1]−G[i+2,j−1]+2·G[i,j+1]−G[i−2,j+1]−G[i+2,j+1])/16   expression 53

[0226]Gh 45=(G[i−1,j]+G[i+1,j])/2+(2·Z[i,j]−Z[i−2,j]−Z[i+2,j])/8+(2·Z[i+1,j−1]−Z[i−1,j−1]−Z[i+3,j−1]+2·Z[i−1,j+1]−Z[i−3,j+1]−Z[i+1,j+1])/16   expression 54

[0227]Gh 135=(G[i−1,j]+G[i+1,j])/2+(2·Z[i,j]−Z[i−2,j]−Z[i+2,j])/8+(2·Z[i−1,j−1]−Z[i−3,j−1]−Z[i+1,j−1]+2·Z[i+1,j+1]−Z[i−1,j+1]−Z[i+3,j+1])/16   expression 55

[0228] It is to be noted that the arithmetic operations defined in expressions 50 through 55 are each equivalent to correcting the average value of the green color component (corresponds to the first term in each expression) by using correction terms (corresponds to the second and third terms in each expression) each constituted of a quadratic differential (a second derivative).

[0229] Once the G interpolation value is calculated as explained above, the image processing unit 11 calculates an R interpolation value (an interpolation value for the red color component) and a B interpolation value (an interpolation value for the blue color component).

[0230] First, the image processing unit 11 generates color differences corresponding to the specific color components of the pixels at each of which color information corresponding to the red color component or color information corresponding to the blue color component is present based upon the results of the judgment on the vertical/horizontal similarity and obtains through interpolation the color difference corresponding to the missing color component for each pixel at which color information corresponding to the red color component or color information corresponding to the blue color component is not present (FIG. 7, S2).

[0231] It is to be noted that the image processing unit 11 also executes low-pass filter processing for applying a low-pass filter to the color differences at the individual pixels in addition to the calculation of the color difference interpolation values so as to reduce the extent of color artifacts attributable to color moire occurring over an area where the image includes a periodic structure, as in the “color judgment image generation processing”.

[0232] Since the color differences can be generated or obtained through interpolation in a manner similar to that with which the color judgment image is generated (expressions 5 through 8) in step S3 in FIG. 4, a detailed explanation is omitted. However, while the color differences are generated by using the index HV[i,j] set in correspondence to the different color similarity factors during the color judgment image generation, the color differences are generated in this processing by using the index HV[i,j] reset in correspondence to the same color similarity factors for pixels each classified as a lightly saturated image portion or a saturated image portion in the “color judgment processing”.

[0233] In addition, by storing-the color differences generated or obtained through interpolation into the storage area in which the color judgment image has been stored, it is possible to reduce the size of the storage area required during the interpolation processing. However, it is to be noted that when reducing the size of the storage area in this manner, it is necessary to initialize the storage area in which the color judgment image has been stored as preliminary processing preceding the “interpolation value calculation processing”.

[0234] Next, the image processing unit 11 calculates the R interpolation value and the B interpolation value through the arithmetic operations expressed in expressions 60 and 61 presented below by using the color differences and the color information corresponding to the green color component (it may be a G interpolation value) (FIG. 7, S3). While the arithmetic operations defined in expressions 60 and 61 only need to be executed for pixels at which color information corresponding to the red color component or color information representing blue color component is missing when directly utilizing the original color information corresponding to the red color component or the original color information corresponding to the blue color component, the arithmetic operations defined in expressions 60 and 61 must be executed for all the pixels in the first embodiment since the color difference signals are corrected so as to reduce the extent of color artifacts attributable to color moire occurring over image areas that include periodic image structures.

R[i,j]=Cr[i,j]+G[i,j]  expression 60

B[i,j]=Cb[i,j]+G[i,j]  expression 61

[0235] As explained above, the first embodiment, which enables a calculation of a highly reliable color index, makes it possible to realize a type of interpolation processing that has not been achieved in the related art, i.e., interpolation processing through which a fine image structure can be successfully restored and, at the same time, defects such as false image structures and color artifacts (false color) can be effectively minimized, by using the color index in the similarity judgment.

[0236] It is to be noted that while an image constituted of color components (the Cr component and the Cb component in a calorimetric system other than the RGB calorimetric system is generated as the color judgment image in the first embodiment, the color judgment image may be instead an image constituted of the three color components R, G and B, calculated through interpolation processing in the related art or through expressions 60 and 61. However, if an image constituted of the three color components R, G and B is used as the color judgment image, an arithmetic operation expressed in expression 10′ below instead of expression 10 must be executed.

Cdiff 0 [i,j]=(|R[i,j]−G[i,j]|+|B[i,j]−G[i,j]|+|R[i,j]−B[i,j]|)/3   expression 10′

[0237] Namely, a color index is obtained by using the color hues between different color components within the same pixel calculated as |R[i,j]−G[i,j]|, |B[i,j]−G[i,j]| and |R[i,j]−B[i,j]| in expression 10′.

SECOND EMBODIMENT

[0238] The following is an explanation of the second embodiment.

[0239] Since the only difference between the second embodiment and the first embodiment is in the “interpolation value calculation processing” executed by the image processing unit 11 and the other aspects of the processing executed in the second embodiment are all identical to those in the first embodiment, the following explanation focuses on the “interpolation value calculation processing” and a repeated explanation of the other processing operations is not provided. It is to be noted that the “interpolation value calculation processing” as referred to in this context includes image processing such as filtering executed following the interpolation value calculation.

[0240]FIG. 15 presents a flowchart of a specific operation, i.e., the “interpolation value calculation processing”, executed by the image processing unit 11 in the second embodiment.

[0241] It is inevitable that the phenomenon of color artifacts occurs due to color filter array sampling at the image capturing sensor regardless of the type of interpolation processing, including that executed in the first embodiment, is implemented. Under normal circumstances, the extent of such color artifacts is reduced by applying a median filter having a wide range of approximately 5×5 to color differences or the hue values of “a” and “b” planes, for instance, obtained by converting the image data to image data in a Lab colorimetric system. However, there is also a disadvantage to applying a wide-range median filter over the entire image plane in that fine color structures in saturated image portions are lost.

[0242] Accordingly, in the “interpolation value calculation processing” executed in the second embodiment, a wide-range median filter is adaptively applied only to image portions that require such median filtering.

[0243] The concepts of the “achromatic area median” and the “bright spot vicinity median” are explained.

Achromatic Area Median

[0244] Applying a median filter to color hue values normally equates to achromatizing the hue values of color artifacts manifesting in close proximity to each other and complementary to each other by replacing the hue values with a median value, and through such achromatization, the extent of color artifacts can be reduced. Thus, if color artifacts having occurred in a nearly achromatic image area are achromatized, no adverse effect results.

[0245] For instance, while color artifacts may be effectively eliminated by applying a median filter with a wide range of approximately 5×5 to the hues, it has been proved through experiment that the adverse effect of such a wide-range median filter manifests in areas (saturated image areas) for which “c” is set in the color classification index BW through the “color judgment processing” in the first embodiment. Accordingly, it is desirable to adaptively apply the median filter to areas with colors that are almost achromatic based upon the corresponding color indices.

[0246] In the following explanation, the application of a wide-range median filter to hues in an area which is not a saturated (chromatic) image area is referred to as “achromatic area median”.

Bright Spot Vicinity Median

[0247] Color artifacts that cannot be completely eliminated by using the “achromatic area median” described above alone among color artifacts which pose problems under normal circumstances includes color artifacts that remains around a bright, isolated white spot (hereafter referred to as bright spot vicinity). The extent of such color artifacts, too, can be reduced by applying a wide-range median filter to the hues.

[0248] Accordingly, in the second embodiment, processing during which a wide-range median filter is applied to hues in bright spot vicinities as well as in areas other than saturated image areas as described above, is executed. A bright spot vicinity is detected by using luminance (or brightness) indices which are obtained independently of the color index used in the “achromatic area median” processing.

[0249] It is to be noted that in the following explanation, the application of a wide-range median filter to hues in the bright spot vicinity is referred to as a “bright spot vicinity median”. The detection of a bright spot vicinity is executed by taking advantage of the following characteristics of bright spot vicinities.

[0250] There is at least one pixel with a high luminance value present in the vicinity.

[0251] The extent to which the luminance fluctuates due to the image structure is far greater compared to other image areas.

Interpolation Value Calculation Processing

[0252] The following is an explanation of the operations executed in the “interpolation value calculation processing in the second embodiment.”

[0253] First, the image processing unit 11 calculates the G interpolation value in conformance to the vertical/horizontal similarity and the diagonal similarity as in step S1 in FIG. 7, in the first embodiment (FIG. 15, S1).

[0254] In addition, the image processing unit 11 generates color differences corresponding to the specific color components of the pixels at each of which color information corresponding to the red color component or color information corresponding to the blue color component is present based upon the results of the judgment on the vertical/horizontal similarity and obtains through interpolation the color difference corresponding to the missing color component for each pixel at which at least color information corresponding to the red color component or color information corresponding to the blue color component is not present as in FIG. 7, S2 (FIG. 15, S2). It is to be noted that in the first embodiment, low pass processing is also executed on the color differences.

[0255] Next, the image processing unit 11 calculates a luminance value by using the color differences and the color information corresponding to the green color component (FIG. 15, S3).

[0256] For instance, the image processing unit 11 may calculate the luminance value Y[i,j] through an arithmetic operation expressed in expression 70 below.

Y[i,j]=(Cr[i,j]|+4·G[i,j]+Cb[i,j])/4   expression 70

[0257] It is to be noted that the arithmetic operation defined in expression 70 is equivalent to calculating the luminance value at an RGB ratio of R:G:B=1:2:1.

[0258] Next, the image processing unit 11 calculates a “luminance index” based upon the luminance value only for each of the pixels having been classified as saturated image portions (pixels for which “c” is set in the color classification index BW) through the “color judgment processing”, which require additional median filter processing, and executes a luminance analysis based upon the “luminance index”, so as to reduce the volume of bright spot vicinity detection processing (FIG. 15, S4).

[0259] It is to be noted that in this example, the luminance analysis is executed by using the luminance index that includes two values, i.e., the maximum value max among the luminance values of a plurality of pixels within a local area surrounding each pixel and a local variance value var of the luminance values of the plurality of pixels, and the color classification index BW[i,j] is set based upon the results of the luminance analysis.

[0260] First, the image processing unit 11 calculates the luminance indices max and var through arithmetic operations executed by using expressions 71 through 73 presented below for each of pixels with respect to which condition 40 indicated below is achieved.

BW[i,j]=‘c’  condition 40

max=Max_of{Y[i,j],Y[i,j−1],Y[i,j+1],Y[i−1,j],Y[i+1,j],Y[i−1,j−1],Y[i+1,j−1],Y[i−1,j+1],Y[i+1,j+1]  expression 71

[0261] It is to be noted that Max_of { } indicates a function used to calculate the maximum value among the plurality of luminance values.

[0262] ave=(Y[i,j]+Y[i,j−1]+Y[i,j+1]+Y[i−1,j]+Y[i+1,j]+Y[i−1,j−1]+Y[i+1,j−1]+Y[i−1,j+1]+Y[i+1,j+1])/9   expression 72

[0263] var=(Y[i,j−1]−ave)²+(Y[i,j+1,]−ave)²+(Y[i−1, j]−ave)²+(Y[i+1,j]−ave)²+(Y[i−1,j−1]−ave)²+(Y[i+1,j−1]−ave)²+(Y[i−1,j+1]−ave)²+(Y[i+1,j+1]−ave)²)/9   expression 73

[0264] Next, the image processing unit 11 judges that any pixel whose luminance indices max and var satisfy a condition expressed as;

max>ThLmax and var>ThLdev²   condition 41

[0265] is in a bright spot vicinity and sets “m” for the color classification index BW[i,j]. It is to be noted that when the gradation of the luminance indices is indicated within the range of 0 through 255, the threshold value ThLmax should preferably be set to, for instance, approximately 220 and the threshold value ThLdev² should preferably be set to, for instance, approximately 45².

[0266] “c” is continuously set and no setting adjustment is made for the color classification index BW[i,j] of pixels that do not satisfy condition 41 (these pixels are not in bright spot vicinities).

[0267]FIG. 16 shows the relationship between the color index and the luminance indices.

[0268] Next, the image processing unit 11 ascertains the results of the “color judgment processing” (FIG. 15, S5) and ascertains the results of the luminance analysis with regard to the pixels classified as saturated image portions based upon the results of the “color judgment processing” (FIG. 15, S6).

[0269] Then, the image processing unit 11 applies to a wide-range median filter to the color differences of pixels having been classified as fully achromatic image portions, achromatic image portions and lightly saturated image portions based upon the results of the “color judgment processing” (pixels each having “z”, “a” or “b” set for the color classification index BW thereof) in the “achromatic area median processing”, and applies a wide-range median filter to the color differences of pixels having been classified as bright spot vicinity image portions based upon the results of the luminance analysis (pixels each having “m” set for the color classification index BW thereof) in the “bright spot vicinity median” processing (FIG. 15, S7).

[0270] For instance, the image processing unit 11 may achieve processing for applying a wide-range median filter to the color differences of each of the pixels that satisfy condition 42 indicated below by recalculating its color differences Cr[i,j] and Cb[i,j] through arithmetic operations defined in the following expressions 74 and 75.

BW[i,j]16 ‘c’  condition 42

Cr[i,j]=Median_of{Cr[i,j],Cr[i,j−2],Cr[i,j+2],Cr[i−2,j],Cr[i+2,j],Cr[i−2,j−2],Cr[i+2,j−2],Cr[i−2,j+2],Cr[i+2,j+2]}  expression 74

Cb[i,j]=Median_of{Cb[i,j],Cb[i,j−2],Cb[i,j+2],Cb[i−2,j],Cb[i+2,j],Cb[i−2,j−2],Cb[i+2,j−2],Cb[i−2,j+2],Cb[i+2,j+2]}  expression 75

[0271] It is to be noted that Median_of { } above indicates a function used to calculate the median value of a plurality of elements and that Cr on the left side represents a value which is temporarily obtained by buffering the results of the arithmetic operation expressed on the right-hand side over the entire pixels and is then used for substitution on the Cr plane.

[0272] While the arithmetic operations expressed in expressions 74 and 75 are equivalent to applying a median filter over the range indicated in FIG. 17(a), the processing for applying a wide-range median filter to the color differences may instead be realized by applying a median filter over the range indicated in FIG. 17(b) so as to achieve a higher speed.

[0273] Next, the image processing unit 11 calculates the R interpolation value and the B interpolation value as in FIG. 7, S3 in the first embodiment (FIG. 15, S8).

[0274] Thus, since the R interpolation value and the B interpolation value are calculated for the individual pixels by using the color differences to which a wide-range median filter has been adaptively applied, the occurrence of color artifacts attributable to the interpolation processing can be reduced while preventing any loss of fine color structures in saturated image areas in the second embodiment.

[0275] It is to be noted that while the color differences of a pixel having been classified as an image portion other than a bright spot vicinity through the luminance analysis are directly used for the calculation of the R interpolation value and the B interpolation value without applying any wide-range median filter in the second embodiment, they may instead undergo processing during which a narrow-range median filter is applied to them as in FIG. 18, S8 first and then may be used for the calculation of the R interpolation value and the B interpolation value. In other words, the interpolation processing may be achieved by executing the “interpolation value calculation processing” shown in FIG. 18 instead of the interpolation value calculation processing shown in FIG. 15.

[0276] For instance, the processing for applying a narrow-range median filter to the color differences of each pixel having been classified as an image portion other than a bright spot vicinity may be realized by recalculating the color differences Cr[i,j] and Cb[i,j] of pixels that satisfy the following condition 43 through the arithmetic operations expressed in expressions 76 and 77 below.

BW[i,j]=‘c’  condition 43

Cr[i,j]=Median_of}Cr[i,j],Cr[i,j−1],Cr[i,j+1],Cr[i−1,j],Cr[i+1,j],Cr[i−1,j−1],Cr[i+1,j−1],Cr[i−1,j+1],Cr[i+1,j+1]}  expression 76

Cb[i,j]=Median_of{Cb[i,j],Cb[i,j−1],Cb[i,j+1],Cb[i−1,j],Cb[i+1,j],Cb[i−1,j−1],Cb[i+1,j−1],Cb[i−1,j+1],Cb[i+1,j+1]}  expression 77

[0277] While the arithmetic operations expressed in expressions 76 and 77 are equivalent to applying a median filter over the range indicated in FIG. 17(c), the processing for applying a narrow-range median filter to the color differences may instead be realized by applying a median filter over the range indicated in FIG. 17(d) so as to achieve a higher speed.

[0278] The interpolation processing which includes the “interpolation value calculation processing” shown in FIG. 18 is particularly effective if executed in a situation in which noticeable color artifacts would manifest over saturated image areas after the interpolation processing that includes the “interpolation value calculation processing” shown in FIG. 15.

[0279] In addition, while median filters are adaptively applied to the color differences based upon the results of the color judgment and the luminance analysis in the second embodiment, such median filter processing can be implemented in a similar manner as additional correcting processing for an image having undergone image restoration processing achieved through the interpolation technology in the related art and executed by using data obtained at a single-substrate image-capturing sensor. However, when executing such additional correction processing subsequently, the color judgment image should be generated with the color information of the image having undergone the image restoration processing and the color index should be calculated by using this color judgment image. The image having undergone image restoration processing that will benefit from the additional correction processing may be an image obtained through image restoration processing executed by using data generated at a 2-substrate type image-capturing sensor, an image obtained through image restoration processing executed by using data at a Y:Cb:Cr ratio of 4:1:1 or the like.

THIRD EMBODIMENT

[0280] The following is an explanation of the third embodiment.

[0281] Since the only difference between the third embodiment and the first and second embodiments is in the “color judgment processing” executed by the image processing unit 11 and the other aspects of the processing executed in the second embodiment are all identical to those in the first and second embodiments, the following explanation focuses on the “color judgment processing” and a repeated explanation of the other processing operations is not provided.

[0282]FIG. 19 presents a flowchart of a specific operation, i.e., the “color judgment processing”, executed by the image processing unit 11 in the third embodiment.

[0283] There is still a risk that an achromatic image portion is erroneously judged to be a saturated portion because of color artifacts occurring in the color judgment image in the “color judgment processing” executed in the first embodiment in which the color index is calculated by using the color judgment image generated through the “color judgment image generation processing” and the color judgment is made based upon the color index. For instance, a pixel which should be classified as an achromatic image portion and accordingly should undergo a vertical/horizontal similarity judgment by using the different color similarity factors may be erroneously classified as a saturated image portion due to the occurrence of color artifacts such as color moire and thus, its vertical/horizontal similarity may be judged based upon the same color similarity factors.

[0284] Accordingly, in the “color judgment processing” in the third embodiment, the method explained in reference to the second embodiment is also adopted in conjunction with the “color judgment image” and the color judgment is executed twice, so as to improve the accuracy of the similarity judgment.

Color Judgment Processing

[0285] The following is an explanation of the operation executed in the “color judgment processing” in the third embodiment, given in reference to FIG. 19.

[0286] First, the image processing unit 11 calculates a color index Cdiff as in FIG. 5, S1 in the first embodiment by using the color judgment image generated through the “color judgment image generation processing” (FIG. 19, S1).

[0287] In addition, the image processing unit 11 executes a first color judgment based upon the color index Cdiff[i,j] calculated for each pixel (FIG. 19, S2) as in FIG. 5, S2 in the first embodiment and sets a color classification index BW[i,j].

[0288] Next, the image processing unit 11 calculates a G interpolation value to enable calculation of a luminance value, and then calculates the luminance value by using a G plane image, which is constituted of the G interpolation value and the original color information corresponding to the green color component, and the color judgment images (Cr, Cb plane images) (FIG. 19, S3).

[0289] For instance, the image processing unit 11 calculates the average of the values indicated by the color information corresponding to the green color component at the adjacent pixels as the G interpolation value of each pixel at which color information corresponding to the green color component is missing. It is to be noted that the G interpolation value may instead be calculated as in the related art. In addition, the luminance value Y[i,j] should be calculated through an arithmetic operation similar to that expressed in expression 70 used in the second embodiment.

[0290] Next, the image processing unit 11 calculates the luminance indices by using the luminance value as in FIG. 15, S4 in the second embodiment for each pixel having been classified as a saturated image portion in the first color judgment (each pixel having “c” set in the color classification index BW thereof) and executes a luminance analysis based upon the luminance indices (FIG. 19, S4).

[0291] Next, the image processing unit 11 executes a color judgment based upon the color index Cdiff (FIG. 19, S5) and ascertains the results of the luminance analysis for each pixel having been classified as a saturated image portion based upon the results of the color judgment (FIG. 19, S6).

[0292] Then, the image processing unit 11 executes processing for applying wide-range median filters to the color differences constituting the color judgment image, through arithmetic operations similar to those expressed in expressions 74 and 75 used in the second embodiment for pixels having been classified as fully achromatic image portions, achromatic image portions and lightly saturated image portions based upon the results of the color judgment (pixels each having “z”, “a” or “b” set in the color classification index BW thereof) and pixels having been classified as bright spot vicinities based upon the results of the luminance analysis (pixels each having “m” set in the color classification index BW thereof) (FIG. 19, S7).

[0293] Next, the image processing unit 11 recalculates the color index Cdiff as in FIG. 5, S1 in the first embodiment (FIG. 19, S8).

[0294] In addition, the image processing unit 11 executes a second color judgment as in FIG. 5, S2 in the first embodiment based upon the recalculated color index Cdiff (FIG. 19, S9) and resets the color classification index BW.

[0295] Namely, the color index Cdiff is recalculated by using the color judgment image having undergone the adaptive median filter processing and the second color judgment is executed based upon the recalculated color index Cdiff in the third embodiment. Consequently, pixels having been erroneously classified as saturated image portions in the first color judgment due to color artifacts manifesting in the color judgment image can be correctly classified as achromatic image portions through the second color judgment.

[0296] Thus, in the third embodiment, the occurrence of the error in which the vertical/horizontal similarity of a pixel that should be classified as an achromatic image portion is judged by using the same color similarity factors by mistake and the occurrence of the error in which the vertical/horizontal similarity of a pixel that should be classified as a saturated image portion is not correctly judged by using the same color similarity factors can be reduced in the “similarity judgment processing”. As a result, the accuracy of the similarity judgment executed during the interpolation processing improves and the occurrence of color artifacts can be reduced.

[0297] It is to be noted that while the color differences of a pixel having been classified as an image portion other than a bright spot vicinity image through the luminance analysis are directly used to generate the color judgment image without applying any wide-range median filter in the third embodiment, they may instead undergo processing during which a narrow-range median filter is applied to them as in FIG. 20, S8 and then used to generate the color judgment image. In other words, the interpolation processing may be achieved by executing the “color judgment processing” shown in FIG. 20 instead of the color judgment processing shown in FIG. 19. For instance, processing for applying a narrow-range median filter to the color differences of each pixel having been classified as an image portion other than a bright spot vicinity image may be realized by recalculating the color differences Cr[i,j] and Cb[i,j] of pixels that satisfy the condition 43 through the arithmetic operations expressed in expressions 76 and 77 presented earlier.

[0298] Furthermore, while bright spot vicinity median pixels are additionally extracted through the luminance analysis in the third embodiment, a higher priority may be given to faster processing by using achromatic area median pixels alone, and in such a case, the necessity for calculating the luminance value (FIG. 19, S3) or executing the luminance analysis (FIG. 19, S4 and S6) is eliminated to simplify the “color judgment processing”.

FOURTH EMBODIMENT

[0299] No illustrates are provided with respect to the fourth embodiment and its explanation provided below focuses on the “G interpolation value calculation processing” executed by the image processing unit 11, since the fourth embodiment only differs from the preceding embodiments described earlier in the “G interpolation value calculation processing” (S1 in FIG. 7, S1 in FIG. 15) executed as part of the “interpolation value calculation processing” by the image processing unit.

[0300] There is a problem in the related art technology in that Nyquist frequency level fine structures such as check patterns are not reflected in the interpolation values. Such fine structures in the image can be restored by replacing the interpolation values with the original color information. However, while such a replacement is effective over areas containing Nyquist frequency level fine image structures, an indiscriminate replacement is likely to cause highly undesirable consequences (such as breakdown of the image).

[0301] Accordingly, in the fourth embodiment, the interpolation values are replaced with the original color information only over areas that require such a replacement. However, since a full replacement of an interpolation value of the pixel undergoing the interpolation processing with the original color information initially present at the pixel may sometimes result in the Nyquist frequency level fine image structure becoming too noticeable, and for this reason, an acceptable level of continuity with the surrounding image structure is assured in the fourth embodiment by using the average of the interpolation value calculated through any of the embodiments explained earlier and the value indicated in the original color information as the interpolation value of the interpolation target pixel. Hereafter, the term “replacement interpolation” is used to collectively refer to both a full replacement and an interpolation value calculation executed through a partial replacement corresponding to a specific ratio.

[0302] Now, an explanation is given with regard to areas for which the “replacement interpolation” should be executed.

[0303] While areas over which the “replacement interpolation” can be executed include fully achromatic image areas, these areas have been proven through experiment to correspond to areas (fully achromatic areas) containing pixels with “z” set in the color classification index BW thereof through the “color judgment processing” executed in the first embodiment or the third embodiment. It is to be noted that since strict control is implemented to ensure that the color differences of pixels in areas with “z” set for the color classification index BW thereof are never higher than 2 when the gradations of the color differences are within the range of 0 through 255, the “replacement interpolation” is only allowed to be executed for areas manifesting color differences which are less than 1% of the maximum gradation.

[0304] It is to be noted that the vertical/horizontal similarity at fully achromatic image portions is judged by using the different color similarity factors in the embodiments explained earlier and that since the image structure in a given area for which the direction(s) along which marked similarity manifests is identified through such a judgment is highly likely to be a fine structure with a longer cycle frequency than the Nyquist frequency, information indicating the irregularity (or curvature) in the fine image structure can be considered to be reflected in the interpolation values through the correction terms in expressions 50 through 55.

[0305] Namely, areas that require the “replacement interpolation” are limited to those areas for which a specific direction along which marked similarity manifests cannot be identified (pixels classified as case 5 through the “similarity judgment processing”) among the fully achromatic areas.

G Interpolation Value Calculation Processing

[0306] The following is an explanation of the “G interpolation value calculation processing” executed in the fourth embodiment.

[0307] First, after the “color judgment processing” (S1 and S2 in FIG. 5, S1 through S11 in FIG. 19) and the “similarity judgment processing” (FIG. 6, S1 through S5) are completed, the image processing unit 11 ascertains the exact value set for the index HV[i,j] indicating the vertical/horizontal similarity and the index DN[i,j] indicating the diagonal similarity and classifies the type of the similarity manifesting at the interpolation target pixel as one of; case 1 through case 9, as in the first embodiment.

[0308] Then, the image processing unit 11 calculates the G interpolation values G[i,j] for interpolation target pixels classified as cases 1 through 4 and cases 6 through 9 respectively through arithmetic operations expressed in expressions 40 through 43 and expressions 45 through 49 used in the first embodiment.

[0309] In addition, the image processing unit 11 makes a decision as to whether or not each of the interpolation target pixels classified as case 5 has been classified as a fully achromatic image portion based upon the results of the color judgment (equivalent to making a decision as to whether or not “z” is set in the color classification index BW).

[0310] Then, the image processing unit 11 executes the “replacement interpolation” for each pixel having been classified as case 5 and also classified as a fully achromatic image portion by calculating the G interpolation value G [i,j] through an arithmetic operation expressed in expression 80 presented below. In addition, the image processing unit 11 calculates the G interpolation value G[i,j] for each pixel having been classified as case 5 but also classified as an image portion other than a fully achromatic image portion through expression 44 used in the first embodiment.

G[i,j]=(Z[i,j]+(Gv+Gh))/2   expression 80

[0311] Gv and Gh above are the values calculated through expressions 50 and 53 respectively.

[0312] As explained above, Nyquist frequency level fine image structures can be restored through the “replacement interpolation” which is executed adaptively in the fourth embodiment.

[0313] It is to be noted that while the average value of an interpolation value calculated in any of the preceding embodiments and the value indicated in the original color information is used as an interpolation value of the interpolation target pixel in the fourth embodiment, the interpolation value of the interpolation target pixel may instead be completely replaced with the value indicated in the original color information initially present at the pixel if low-pass filtering is executed for the green color component or the luminance component after the interpolation processing is completed since an averaging operation is executed in such a case.

FIFTH EMBODIMENT

[0314] The following is an explanation of the operations executed in the fifth embodiment.

[0315] It is assumed that an image processing program (an image processing program that executes interpolation processing in a manner similar to that with which the interpolation processing is executed by the image processing unit 11 in one of the embodiments explained earlier) recorded in a recording medium such as a CDROM 28 is pre-installed at a PC 18. Namely, such an image processing program is stored in a hard disk (not shown) within the PC 18 in an execution-enabled state in which the program can be executed by the CPU (not shown).

[0316] The following is an explanation of the operations executed in the fifth embodiment, given in reference to FIG. 1.

[0317] As the photographing mode has been selected by the operator and the shutter release button has been pressed via the operation unit 24 in the electronic camera 1, image signals having been generated at the image-capturing sensor 21 and having undergone a specific type of analog signal processing at the analog signal processing unit 22 are digitized at the A/D conversion unit 10, and thus, the digital image signals are provided as image data to the image processing unit 11. The image processing unit 11 executes image processing such as gradation conversion and γ correction on the image data thus provided. Upon completion of the image processing, the image data are recorded into the memory card 16 via the memory card interface unit 17.

[0318] Next, in response to an instruction for an image data transfer issued by the PC 18 via the external interface unit 19 while the current mode selected by the operator via the operation unit 24 is a PC communication mode, the electronic camera 1 reads out the image data corresponding to the instruction from the memory card 16 via the memory card interface unit 17. Then, it provides the image data thus read out to the PC 18 via the external interface unit 19.

[0319] Upon receiving the image data thus provided, the CPU (not shown) inside the PC 18 executes the image processing program. It is to be noted that the image data having undergone the interpolation processing in conformance to the image processing program in this manner may be compressed as necessary and recorded into a hard disk (not shown) or they may be converted to the calorimetric system adopted at the monitor 26 or the printer 27 and be provided to the corresponding device.

[0320] As explained above, interpolation processing similar to the interpolation processing achieved in any of the embodiments explained earlier can be realized on the PC 18 in the fifth embodiment.

[0321] It is to be noted that the CPU (not shown) inside the PC 18 may read out image data from the memory card 16 and execute the image processing program when the memory card 16 having the image data recorded therein as described above is loaded into the PC.

[0322] Furthermore, such an image processing program may be downloaded to the PC 18 accessing a specific homepage via the Internet.

[0323] Moreover, instead of executing the image processing program on the PC 18, it may be executed at a remote server or the like connected via the Internet or the like. In this case, the PC 18 only needs to transfer image data provided by the electronic camera 1 to a server or the like capable of executing the image processing program via the Internet or the like to have interpolation processing similar to the interpolation processing in any of the embodiments explained earlier executed on the image data.

[0324] In addition, while an explanation is given above in reference to the embodiments on an example in which the interpolation processing is executed on an image expressed in the RGB calorimetric system with color information corresponding to one of the three color components, R, G and B, present at each pixel, similar interpolation processing may be executed on an image expressed in another calorimetric system.

[0325] Furthermore, while an explanation is given above in reference to the embodiments on an example in which the interpolation processing is executed on image data with the various color components arrayed as illustrated in FIG. 2, image data that are processed by adopting the present invention may assume an array other than that shown in FIG. 2.

[0326] Through the interpolation processing explained earlier in reference to each of the embodiments, which is part of the image restoration processing, color information corresponding to all of the three color components, R, G and B, is ultimately set for each pixel. However, the present invention is not limited to interpolation processing, and it may be equally effectively adopted in image restoration processing through which color information corresponding to all the color components in a colorimetric system other than the RGB colorimetric system is set in correspondence to each pixel.

[0327] For instance, in the eighth embodiment to be detailed later, color information corresponding to three color components, Y, Cb and Cr is set for all the pixels. In other words, the present invention is adopted in image restoration processing for setting color information corresponding to all the color components constituting a colorimetric system (the YCbCr colorimetric system in this case), other than the RGB colorimetric system (the calorimetric system in which the image undergoing the image restoration processing is expressed) for each pixel in the eighth embodiment.

[0328] Namely, the “similarity judgment processing” achieved in any of the embodiments explained above can be adopted in image restoration processing through which color information corresponding to the color components constituting another colorimetric system is newly generated as well as in the image restoration processing for interpolating the RGB calorimetric system.

[0329] In addition, processing equivalent to the “replacement interpolation” achieved in the fourth embodiment can be adopted in image restoration processing for newly generating color information corresponding to the color components constituting another calorimetric system as well as in the image restoration processing for interpolating image data in the RGB calorimetric system.

[0330] For instance, when color information corresponding to the Y component is calculated for a pixel at which the color information originally present corresponds to the red color component as “(R+2·G+B)/4” by using nearby color information corresponding to the green color component and the blue color component in image restoration processing executed to set color information corresponding to the Y, Cb and Cr components for each of the pixels of an image constituted of color information corresponding to the three color components R, G and B arranged in a Bayer array, executing processing equivalent to the “replacement interpolation” equates to calculating the Y component as “(2·R+G+B)/4”. In other words, half of the color information corresponding to the G color component is replaced with the color information corresponding to the red color component in this case.

[0331] The following advantages are achieved in the electronic camera in the embodiments described above.

[0332] Since the image restoration processing is executed by switching to a more desirable restoration value generation method, fine image structures can be restored and, at the same time, defects such as false image structures and color artifacts is minimized to obtain a restored image achieving a good overall balance.

[0333] The accuracy with which the color index is calculated is improved by increasing the accuracy of the hue values within a given pixel, and thus, the occurrence of color artifacts attributable to the execution of the image restoration processing can be further reduced.

[0334] Since the similarity is judged adaptively in conformance to the color index and the restoration values are generated accordingly, defects such as false structures and color artifacts can be even more effectively prevented.

[0335] Since a restoration value is adaptively replaced with the original color information, the accuracy with which fine image structures are restored is improved.

[0336] The accuracy of the similarity factor calculation executed in the image restoration processing is improved.

[0337] By adaptively executing correction in the image restoration processing, any loss of fine color structures is avoided and the occurrence of color artifacts is reduced. As a result, the image restoration processing is executed while the image maintains a good overall balance.

[0338] The accuracy with which the color index is calculated is improved.

[0339] Correction can be made in a desirable manner during the image restoration processing and, at the same time, the adverse effect of over-correction is minimized.

[0340] The correction can be executed in a desirable manner during the image restoration processing.

[0341] The accuracy with which the luminance indices calculated is improved.

SIXTH EMBODIMENT Structure of Electronic Camera

[0342] Since the structure of the electronic camera 1 achieved in the sixth embodiment is similar to that shown in the functional block diagram presented in FIG. 1 in reference to which the electronic camera corresponding to the first through fourth embodiments has been explained and its explanation is omitted.

Conversion of Image Data

[0343] Processing through which image data in the RGB calorimetric system obtained via the image-capturing sensor 21 are converted to image data expressed in a GCrCb colorimetric system is explained. Image data obtained through an image-capturing operation executed at the image-capturing sensor 21 and input to the image processing unit 11 via the analog signal processing unit 22 and the A/D conversion unit 10 are expressed in the RGB calorimetric system assuming a Bayer array and, as explained earlier, color information corresponding to a single color component is present at each pixel. Hereafter, such image data may also be referred to as pre-conversion RGB image data. The pre-conversion RGB image data are converted to image data that include information G corresponding to the luminance component (referred to as luminance information G or a luminance signal G) and information Cr and Cb corresponding to the color difference components (chrominance) (referred to as color difference information Cr and Cb or color difference signals Cr and Cb) for each pixel. The image data resulting from the conversion are referred to as post-conversion GCrCb image data. FIG. 21 shows different concepts of data conversion, with FIG. 21(a) presenting a conceptual diagram of the conversion implemented in the sixth embodiment and FIG. 21(b) presenting a conceptual diagram of the conversion executed in the eighth embodiment to be detailed later. It is to be noted that since sets of color information each corresponding to a color components that are present at the individual pixels are separated from one another in the pre-conversion RGB image data, the pre-conversion RGB image data may be regarded as data constituting a multispectral image obtained through spatial spectral separation.

[0344] The pre-conversion RGB image data are now explained in reference to FIGS. 2(a) through 2(d). FIGS. 2(a) through 2(d) each show the specific arrangement of the color components at the pixels surrounding the conversion target pixel corresponding to a given color component. The coordinates of the conversion target pixel are indicated as [i,j]. FIG. 2(a) shows the conversion target pixel [i,j] having color information corresponding to the R color component and FIG. 2(b) shows the conversion target pixel [i,j] having color information corresponding to the B color component. FIG. 2(c) shows the conversion target pixel [i,j] having color information corresponding to the G color component with pixels adjacent along the vertical direction having color information corresponding to the B color components and pixels adjacent along the horizontal direction having color information corresponding to the R color component, whereas FIG. 2(d) shows the conversion target pixel [i,j] having color information corresponding to the G color component with the pixels adjacent along the vertical direction having color information corresponding to the R color component and the pixels adjacent along the horizontal direction having color information corresponding to the B color component.

[0345] A pixel having color information corresponding to the R color component, a pixel having color information corresponding to the B color component and a pixel having color information corresponding to the G color component in the pre-conversion RGB image data are respectively referred to as an R pixel, a B pixel and a G pixel.

[0346]FIG. 22 presents a flowchart of the overall image data conversion processing executed by the image processing unit 11. FIG. 23 is a block diagram provided to facilitate the explanation of the relationship among various types of processing. Now, the image data conversion processing executed by the image processing unit 11 is outlined in reference to FIGS. 22 and 23.

[0347] In step S1, a Bayer plane (101 in FIG. 23), i.e., the pre-conversion RGB image data, is input. In step S2, by using the color information corresponding to the various color components in the pre-conversion RGB image data, a Cr plane and a Cb plane, i.e., color difference information Cr and Cb, are generated for all the pixels (102 in FIG. 23). At this time, a vertical/horizontal judgment 1 is executed (103 in FIG. 23) by using different color similarity factors and the color difference information Cr and the color difference information Cb are generated based upon the results of the vertical/horizontal judgment 1. In step S3, a color evaluation is performed by using the color difference information Cr and the color difference information Cb (104 in FIG. 23). In the color evaluation, an evaluation is made with regard to the target pixel as to whether it is an achromatic pixel or a color pixel and extent of the saturation if the pixel is judged to be a chromatic pixel.

[0348] In step S4, a G plane, i.e., luminance information G, is generated for all the pixels. When generating the luminance information G, a selection is made as to whether the results of the vertical/horizontal judgment 1 (103 in FIG. 23) executed by using different color similarity factors should be used or the results of the vertical/horizontal judgment 2 (105 in FIG. 23) executed by the using the same color similarity factors should be used based upon the results of the color evaluation obtained in step S3 (106 in FIG. 26). Then, the luminance information G is generated in conformance to the results of the vertical/horizontal judgment executed by using either the different color similarity factors or the same color similarity factors selected based upon the results of the color evaluation (FIG. 23, 107). Namely, based upon the results of the judgment made with regard to the extent of similarity manifesting along the vertical/horizontal directions, the luminance information G is generated by utilizing the color information present within a local area containing the target pixel. The local area in this context refers to an area ranging over, for instance, several pixels to several tens of pixels. The local area may even range over 100 pixels or more. In other words, the local area is an area constituted of pixels, the number of which justifies the use of the adjective “local” relative to the overall size of the image.

[0349] In step S5, the color difference information Cr and Cb generated in step S2 and the luminance information G generated in step S4 are output as image data which then undergo various types of image processing or are stored into a memory or the like.

[0350] It is to be noted that the number of pixels constituting the pre-conversion RGB image data and the number of pixels in the post-conversion GCrCb image data are equal to each other, and the positions of the individual pixels in these data have a 1-to-1 correspondence in a two-dimensional plane. The image data conversion processing executed on all the pixels as mentioned earlier is achieved by repeatedly executing specific types of image data conversion processing in different target local areas. Accordingly, the following explanation proceeds by referring to relational expressions that are satisfied locally in the individual target areas. A detailed explanation of these specific types of processing is provided below. The explanation is given in the following order. (1 Cr and Cb plane generation) (1-1 Vertical/horizontal judgment 1) (1-1-1 Calculation of similarity factors) (1-1-1-1 Different color similarity factors) (1-1-1-2 Peripheral additions of similarity factors) (1-1-2 Similarity judgment) (1-2 Color difference generation) (1-2-1 R-positioned Cr plane generation) (1-2-2 Cr plane interpolation) (1-2-3 B-positioned Cb plane generation and interpolation) (2 Color evaluation) (2-1 Color difference correction) (2-2 Color index calculation) (2-3 Color judgment) (3 G plane generation) (3-1 Vertical/horizontal judgment 2) (3-1-1 Calculation of similarity factors) (3-1-1-1 Same color similarity factors) (3-1-1-2 Peripheral additions of similarity factors) (3-1-2 Similarity judgment) (3-2 Directional index selection) (3-3 G calculation) (4 Color image output) The explanation is given as follows. (1 Cr and Cb plane generation) (1-1 Vertical/horizontal judgment 1) (1-1-1 Calculation of similarity factors) (1-1-1-1 Different color similarity factors)

[0351] The vertical/horizontal judgment 1 is executed based upon different color similarity factors calculated by using the color information corresponding to the various color components in the pre-conversion RGB image data having been input. First, “different color similarity factors” are calculated for R pixels and B pixels. A different color similarity factor indicates the level of similarity manifesting between the conversion target pixel and surrounding pixels, which is expressed as a numerical value calculated by using the color information corresponding to different color components present within a local area containing the conversion target pixel. In this embodiment, the different color similarity factor along the vertical direction and the different color similarity factor along the horizontal direction are ascertained and a judgment is made as to whether marked similarity manifests along the vertical direction or the horizontal direction. Each set of color information indicates a value obtained by digitizing a color signal generated at the image-capturing sensor 21 through a specific type of processing. Such color information may be represented in, for instance, one byte 256 gradations. [x,y] indicates the coordinates of a given pixel and the coordinates of the conversion target pixel are indicated as [i,j]. Color information present at a G pixel is indicated as G [x, y] , color information present at an R pixel is indicated as R [x, y], color information present at a B pixel is indicated as B[x,y], and color information present at either an R pixel or a B pixel is summarily indicated as Z[x,y]. The different color similarity factor Cv0[i,j] along the vertical direction can be ascertained through an arithmetic operation executed as defined in expression (101), whereas the different color similarity factor Ch0[i,j] along the horizontal direction can be ascertained through an arithmetic operation as defined in expression (102). If the conversion target pixel is an R pixel, the similarity factors are determined by calculating GR similarity factor components, whereas if the conversion target pixel is a B pixel, the similarity factors are determined by calculating GB similarity factor components. The term “similarity factor component” is used in this explanation to refer to a specific combination of color components constituting a given similarity factor.

GR (GB) Similarity Factor Components Cv 0 [i,j]=(|G[i,j−1]−Z[i,j]|+|G[i,j+1]−Z[i,j]|)/2   (101)

Ch 0 [i,j]=(|G[i−1,j]−Z[i,j]|+|G[i+1,j]−Z[i,j]|)/2   (102)

[0352] The vertical different color similarity factor Cv0[x,y] and the horizontal different color similarity factor Ch0[x,y) are determined for the R pixels and the B pixels present in the target area in the pre-conversion RGB image data.

[0353] It is to be noted that when the conversion target pixel is an R pixel or a B pixel, the G pixels directly adjacent to the conversion target pixel constitute different color pixels present along the vertical and horizontal directions relative to the conversion target pixel (see FIGS. 2(a) and 2(b). Namely, the “different color similarity factors”, with which the similarity is judged over a one-pixel pitch, enables a more accurate similarity judgment for a Nyquist frequency level fine image structure with changes occurring in a one-pixel pitch.

1-1-1-2 Peripheral Additions of Similarity Factors

[0354] Next, peripheral additions of similarity factors are executed. During this process, the arithmetic operations defined in expressions (103) and (104) are executed by using the vertical different color similarity factors Cv0[x,y] and the horizontal different color similarity factors Ch0[x,y] calculated as explained above. The objective of these peripheral additions is to improve the accuracy of the similarity factors by taking into consideration the continuity with the surrounding pixels. It is to be noted that the peripheral additions may be skipped if priority is to be given to simplicity and higher processing speed.

[0355]Cv[i,j]=(4*Cv 0 [i,j]+2*(Cv 0 [i−1,j−1]+Cv 0 [i+1,j−1]+Cv 0 [i−1,j+1]+Cv 0 [i+1,j+1])+Cv 0 [i,j−2]+Cv 0 [i,j+2]+Cv 0 [i−2,j]+Cv 0 [i+2,j])/16   (103)

[0356]Ch[i,j]=(4*Ch 1 [i,j]+2*(Ch 0 [i−1,j−1]+Ch 0 [i+1,j−1]+Ch 0 [i−1,j+1]+Ch 0 [i+1,j+1])+Ch 0 [i,j−2]+Ch 0 [i,j+2]+Ch 0 [i−2,j]+Ch 0 [i+2,j])/16   (104)

1-1-2 Similarity Judgment

[0357] Next, the similarity judgment is executed. In this process, a specific manner with which the conversion target pixel manifests similarity is judged by using Cv[i,j] and Ch[i,j] determined as described above. Namely, in the sixth embodiment, a judgment is made as to whether marked similarity manifests along the vertical direction or along the horizontal direction, or if it is not possible to identify either the vertical direction or the horizontal direction as the specific direction along which marked similarity manifests. More specifically, if condition (105) is satisfied, it is judged that specific vertical/horizontal similarity cannot be ascertained and 0 is set for a directional index HVd[i,j]. Th0 represents a specific threshold value which may assume a value of 10, for instance, when there are 256 gradations. In other words, if the difference between the vertical similarity factor and the horizontal similarity factor is equal to or smaller than the threshold value Th0, the judgment as to whether marked similarity manifests along the vertical direction or along the horizontal direction cannot be made.

|Cv[i,j]−Ch[i,j]≦Th 0   (105)

[0358] If condition (105) is not satisfied, i.e., if it is judged that a marked similarity manifests along either the vertical direction or the horizontal direction, a judgment is then made as to whether or not condition (106) is satisfied. If condition (106) is satisfied, it is determined that a marked similarity manifests along the vertical direction and 1 is set for the directional index HVd [i,j]. If, on the other hand, condition (106) is not satisfied, it is determined that a marked similarity manifests along the horizontal direction and −1 is set for the directional index HVd[i,j] . It is to be noted that the smaller the values of the different color similarity factors Cv[i,j] and Ch[i,j], the higher degrees of similarity are indicated.

Cv[i,j]<Ch[i,j]  (106)

[0359] Values of the directional index HVd[x,y] are calculated for all the R pixels and B pixels present in the target area in the pre-conversion RGB image data.

1-2 Color Difference Generation 1-2-1 R-Positioned Cr Plane Generation

[0360] Next, the generation of a color difference information Cr plane for an R pixel is explained. Color difference information Cr is obtained for the pixels in the post-conversion GCrCb image each corresponding to an R pixel in the pre-conversion RGB image data. The expression used at this time is selected in conformance to the value of the similarity directional index HVd[i,j] determined as described above. When HVd[i,j]=1, expression (107) is used to calculate Cr[i,j], when HVd[i,j]=−1, expression (108) is used to calculate Cr[i,j], and when HVd[i,j]=0, expression (109) is used to calculate Cr[i,j].

Cr[i,j]=(2*R[i,j]+R[i,j−2]+R[i,j+2])/4−(G[i,j−1]+G[i,j+1])/2   (107)

Cr[i,j]=(2*R[i,j]+R[i−2,j]+R[i+2,j])/4−(G[i−1,j]+G[i+1,j])/2   (108)

Cr[i,j]=(4*R[i,j]+R[i,j−2]+R[i,j+2]+R[i−2,j]+R[i+2,j])/8−(G[i,j−1]+G[i,j+1]+G[i−1,j]+G[i+1,j])/4   (109)

1-2-2 Cr Plane Interpolation

[0361] Next, the Cr plane is interpolated. Color difference information Cr for pixels corresponding to B pixels and G pixels is obtained through interpolation processing by using the color difference information Cr obtained for the pixels corresponding to the R pixels. Expression (110) is used to obtain color difference information Cr for each pixel corresponding to a B pixel, expression (111) is used to obtain color difference information Cr for each pixel corresponding to a G pixel with R pixels set adjacent to it along the vertical direction, and expression (112) is used to obtain color difference information Cr for each pixel corresponding to a G pixel with R pixels set adjacent to it along the horizontal direction.

Cr[i,j]=(Cr[i−1,j−1]+Cr[i−1,j+1]+Cr[i+1,j−1]+Cr[i+1,j+1])/4   (110)

Cr[i,j]=(Cr[i−1,j]+Cr[i+1,j])/2   (111)

Cr[i,j]=(Cr[i,j−1]+Cr[i,j+1])/2   (112)

1-2-3 B-Positioned Cb Plane Generation and Interpolation

[0362] Color difference information Cb is also obtained in a manner similar to that with which the color difference information Cr is obtained as described above. Thus, the color difference information Cr and the color difference information Cb are obtained for each pixel in the target area in the post-conversion GCrCb image data. It is to be noted that the color difference information Cr and the color difference information Cb obtained as described above are mathematically equivalent to color difference information obtained after obtaining color information corresponding to the R, G and B color components for the corresponding pixel in the target area in the pre-conversion RGB image data through interpolation processing.

[0363] In addition, the directional index HVd[i,j] set based upon the similarity judgment executed by using the different color similarity factors alone is used in the explanation above, since the occurrence of color artifacts in the vicinity of a Nyquist frequency can be greatly suppressed in this manner.

2 Color Evaluation 2-1 Color Difference Correction

[0364] Prior to the color evaluation, the color information Cr and the color information Cb are corrected to remove any color moire manifesting at the Cr and Cb color difference planes obtained as described above, so as to achieve an accurate color evaluation. While the correction may be executed by using a color difference median filter, a low-pass filter expressed in the following expression (113) and illustrated in FIG. 24 is used in the sixth embodiment. Through this-processing, color moire can be quickly eliminated.

TCr 1 [i,j]={4*Cr[i,j]+2*(Cr[i−2,j]+Cr[i+2,j]+Cr[i,j−2]+Cr[i,j+2])+1*(Cr[i−2,j−2]+Cr[i+2,j−2]+Cr[i−2,j+2]+Cr[i+2,j+2])}/16   (113)

[0365] TCb1[i,j], too, is determined in a similar manner.

[0366] As described above, by ascertaining the structure surrounding each pixel, the color difference information assumed to be distributed with spatial directionality is converted to color difference information indicating accurate gradations for the individual pixels to generate the color difference information Cr and the color difference information Cb. Thus, the color difference information Cr and the color difference information Cb indicate scalar quantities that enable a measurement of the actual hues of the image in units of the individual pixels by almost completely eliminating the structural factors in the image. While the color difference between R and G indicated by the color difference information Cr and the color difference between B and G indicated by the color difference information Cb, which are used to calculate the color index, are already determined, they are provided as scalar quantities for each pixel and thus, it becomes possible to evaluate the color difference between R and B as well. As a result, a color evaluation which is very close to a visual human perception of color is achieved.

2-2 Color Index Calculation

[0367] Expression (114) presented below is used to calculate the color index Cdiff.

Cdiff[i,j]=(|TCr 1 [i,j]|+|TCb 1 [i,j]|+|TCr 1 [i,j]−TCb 1 [i,j]|)/3   (114)

[0368] Through the expression, a highly accurate color index can be obtained by separating the disturbance factor attributable to the structure, which poses a problem in the color level evaluation in the related art, from the actual color and also by assessing the color differences manifesting in possible combinations of the all color components. It is to be noted that during this process, too, peripheral additions similar to the peripheral additions of the similarity factors may be executed so as to further improve the accuracy of the color index.

2-3 Color Judgment

[0369] Next, a color judgment is executed. The continuous color index Cdiff[i,j] explained above is converted to color judgment results indicating a discrete color index BW[i,j] by judging the threshold of the continuous color index Cdiff[i,j], i.e., by ascertaining which of conditions (115) through (118), the color index Cdiff[i,j] satisfies. The individual thresholds Thza, Thab and Thbc should respectively assume values of 2, 5 and 15, for instance, when there are 256 graduations.

Cdiff[i,j]≦Thza   (115)

Thza<Cdiff[i,j]≦Thab   (116)

Thab<Cdiff[i,j]≦Thbc   (117)

Thbc<Cdiff[i,j]  (118)

[0370] If condition (115) is satisfied, the pixel is judged to be a fully achromatic image portion and, accordingly, “z” is set for BW[i,j]. If condition (116) is satisfied, the pixel is judged to be an achromatic image portion and, accordingly, “a” is set for BW[i,j]. If condition (117) is satisfied, the pixel is judged to be a lightly saturated image portion and, accordingly, “b” is set for BW[i,j]. If condition (118) is satisfied, the pixel is judged to be a saturated image portion and, accordingly, “c” is set for BW[i,j]. (3 G plane generation) (3-1 Vertical/horizontal judgment 2) (3-1-1 Calculation of similarity factors) (3-1-1 Same color similarity factors)

[0371] Next, using the color index BW[i,j], luminance information G of the post-conversion GCrCb image data is obtained. First, the “same color similarity factors” are calculated for each of the R pixels and B pixels in the pre-conversion RGB image data. A same color similarity factor indicates the level of similarity manifesting between the conversion target pixel and surrounding pixels, which is expressed as a numerical value calculated by using the color information corresponding to a single color component present within a local area containing the conversion target pixel. In this embodiment, the same color similarity factors along the vertical direction and the same color similarity factors along the horizontal direction are ascertained and a judgment is made as to whether a marked similarity manifests along the vertical direction or the horizontal direction.

[0372] Based upon the color information present at the G pixels adjacent to the conversion target pixel, a GG similarity factor component Cv1[i,j] along the vertical direction is calculated through expression (119) and a GG similarity factor component Ch1[i,j] along the horizontal direction is calculated through expression (120).

Cv 1 [i,j]=|G[i,j−1]−G[i,j+1]|  (119)

Ch 1 [i,j]=|G[i−1,j]−G[i+1,j]|  (120)

[0373] Based upon the color information present at pixels corresponding to the color component different from that of the conversion target pixel and also different from the G color component, a BB (RR) similarity factor component Cv2[i,j] along the vertical direction is calculated through expression (121) and a BB (RR) similarity factor component Ch2[i,j] along the horizontal direction is calculated through expression (122).

Cv 2 [i,j]=(|Z[i−1,j−1]−Z[i−1,j+1]|+|Z[i+1,j−1]−Z[i+1,j+1]|)/2   (121)

Ch 2 [i,j]=(|Z[i−1,j−1]−Z[i+1,j−1]|+|Z[i−1,j+1]−Z[i+1,j+1]|)/2   (122)

[0374] The vertical GG similarity factor component Cv1[i,j] and the vertical BB (RR) similarity factor component Cv2[i,j] calculated as explained above are incorporated into expression (123) through which a vertical same color similarity factor Cv0[i,j] is determined for the conversion target pixel [i,j]. In addition, the horizontal GG similarity factor component Ch1[i,j] and the horizontal BB (RR) similarity factor component Ch2[i,j] are incorporated into expression (124) through which a horizontal same color similarity factor Ch0[i,j] is determined for the conversion target pixel [i,j].

Cv 0 [i,j]=(Cv 1 [i,j]+Cv 2 [i,j])/2   (123)

Ch 0 [i,j]=(Ch 1 [i,j]+Ch 2 [i,j])/2   (124)

3-1-1-2 Peripheral Additions of Similarity Factors

[0375] Next, peripheral additions of similarity factors are executed. During this process, the arithmetic operations defined in expressions (125) and (126) are executed by using the vertical same color similarity factors Cv0[x,y] and the horizontal same color similarity factors Ch0[x,y] calculated as explained above. The objective of these peripheral additions is to improve the accuracy of the similarity factors by taking into consideration the continuity with the surrounding pixels, as in the case of the different color similarity factors explained earlier. It is to be noted that the peripheral additions may be skipped if priority is to be given to simplicity and higher processing speed.

[0376]Cv[i,j]=(4*Cv 0 [i,j]+2*(Cv 0 [i−1,j−1]+Cv 0 [i+1,j−1]+Cv 0 [i−1,j+1]+Cv 0 [i+1,j+1])+Cv 0 [i,j−2]+Cv 0 [i, j+2]+Cv 0 [i−2,j]+Cv 0 [i+2,j])/16   (125)

[0377]Ch[i,j]=(4*Ch 0 [i,j]+2*(Ch 0 [i−1,j−1]+Ch 0 [i+1,j−1]+Ch 0 [i−1, j+1]+Ch 0 [i+1, j+1])+Ch 0 [i, j−2]+Ch 0 [i, j+2]+Ch 0 [i−2,j]+Ch 0 [i+2,j])/16   (126)

3-1-2 Similarity Judgment

[0378] Next, the similarity judgment is executed. In this process, a specific manner with which the conversion target pixel manifests same color similarity is judged by using Cv[i,j] and Ch[i,j] determined as described above, as in the different color similarity judgment explained earlier. In the sixth embodiment, a judgment is made as to whether marked similarity manifests along the vertical direction or along the horizontal direction, or if it is not possible to identify either the vertical direction or the horizontal direction as the specific direction along which marked similarity manifests. More specifically, if condition (127) is satisfied, it is judged that specific vertical/horizontal similarity cannot be ascertained and 0 is set for a directional index HVs[i,j]. Th1 represents a specific threshold value which may assume a value of 10, for instance, in conjunction with the 256 gradations, i.e., a value substantially equal to the value of Th0 used in conjunction with the different color similarity factors. In other words, if the difference between the vertical similarity factor and the horizontal similarity factor is equal to or smaller than the threshold value Th1, the judgment as to whether marked similarity manifests along the vertical direction or along the horizontal direction cannot be made.

|Cv[i,j]−Ch[i,j]|≦Th1   (127)

[0379] If condition (127) is not satisfied, i.e., if it is judged that a marked similarity manifests along either the vertical direction or the horizontal direction, a judgment is then made as to whether or not condition (128) is satisfied. If condition (128) is satisfied, it is determined that a marked similarity manifests along the vertical direction and 1 is set for the directional index HVs[i,j]. If, on the other hand, condition (128) is not satisfied, it is determined that a marked similarity manifests along the horizontal direction and −1 is set for the directional index HVs[i,j] . It is to be noted that the smaller the values of the different color similarity factors Cv[i,j] and Ch[i,j], the higher degrees of similarity are indicated.

Cv[i,j]<Ch[i,j]  (128)

[0380] Values of the directional index HVs [x,y] are calculated for all the R pixels and B pixels present in the target area in the pre-conversion RGB image data.

3-2 Directional Index Selection

[0381] Next, a specific type of directional index is selected. Namely, based upon the results of the color judgment explained earlier, either the results of the direction judgment made by using the different color similarity factors or the results of the direction judgment made by using the same color similarity factors are used. If “z” or “a” is set for BW[i,j], HVd[i,j] is selected as HV[i,j]. If “b” or “c” is set for BW[i,j], HVs[i,j] is selected as HV[i,j]. In other words, if the color of the pixel has been judged to be fully achromatic “z” or achromatic “a” in the color judgment, the directional index HVd[i,j] determined by using the different color similarity factors is used. If, on the other hand, the results of the color judgment indicate low saturation (chromatic) “b” or saturation (chromatic) “c”, the directional index HVs[i,j] determined based upon the same color similarity factors is used.

[0382] The values indicated in the color information present at pixels in an achromatic image area are assumed to manifest differences largely attributable to varying lightness levels at the pixels without reflecting differences in the hue. Accordingly, the similarity manifesting in fine image structures can be judged with a higher degree of accuracy based upon the different color similarity factors with which similarity is judged over a one-pixel pitch. In a chromatic area, on the other hand, the values indicated by the color information present at the pixels manifest differences also attributable to the differences in the hue. For this reason, varying values are measured at pixels with different color filters and thus, the similarity cannot be judged with accuracy based upon the different color similarity factors. Accordingly, it is desirable to judge the similarity manifesting in a chromatic image area with the same color similarity factors.

3-3 G Calculation

[0383] Based upon the directional index set as described above, luminance information G, i.e., G[i,j], is obtained for each pixel [i,j] corresponding to an R pixel or a B pixel in the pre-conversion RGB image data. Namely, color information corresponding to the G color component missing at the R pixels and the B pixels is obtained through interpolation processing. When the directional index HV[i,j] is set to 1, i.e., when it has been judged that a marked similarity manifests along the vertical direction, G[i,j] is determined by using expression (129). When the directional index HV[i,j] is set to −1, i.e., when it has been judged that a marked similarity manifests along the horizontal direction, G[i,j] is determined by using expression (130). When the directional index HV[i,j] is set to 0, i.e., when it has been judged that a specific direction, i.e., either the vertical direction or the horizontal direction, cannot be identified as the direction along which marked similarity manifests, G[i,j] is determined by using expression (131).

G[i,j]=(G[i,j−1]+G[i,j+1])/2+(2*Z[i,j]−Z[i,j−2]−Z[i,j+2])/4   (129)

G[i,j]=(G[i−1,j]+G[i+1,j])/2+(2*Z[i,j]−Z[i−2,j]−Z[i+2,j])/4   (130)

G[i,j]=(G[i,j−1]+G[i,j+1]+G[i−1,j]+G[i+1,j])/4+(4*Z [i,j]−Z [i,j−2]−Z [i, j+2]−Z[i−2,j]−Z [i+2,j])/8   (131)

4 Color Image Output

[0384] With the color difference information Cr, the color difference information Cb, and the luminance information G, i.e., Cr[i,j], Cb[i,j] and G[i,j], obtained for each pixel as described above, the conversion of the image data to a desired format of color image data is completed. The post-conversion GCrCb image data may be stored into the memory 13 and began may undergo various types of image processing such as color artifact reduction processing and color correction. The post-conversion GCrCb image data may also be stored into the memory card 16. The image data stored in the memory card 16 may undergo a specific type of colorimetric system conversion processing or a specific type of compression processing (JPEG). It is to be noted that the color difference information Cr[i,j] and the color difference information Cb[i,j] initially stored into the memory 13 are the color difference information generated in

1-2 Color Difference Generation

[0385] To obtain image data in the RGB calorimetric system, i.e., image data requiring color information corresponding to all the color components R, G and B at each pixel in the target area, R[i,j] and B[i,j] are determined through expressions (132) and (133) G[i,j] having been determined as described earlier should be used for these purposes.

R[i,j]=Cr[i,j]+G[i,j]  (132)

B[i,j]=Cb[i,j]+G[i,j]  (133)

[0386] As explained above in the 6th embodiment, accurate color difference information is obtained for each pixel and the color evaluation is executed for the individual pixels by using the color difference information obtained in correspondence to the individual pixels. As a result, an accurate color evaluation is achieved for each pixel without being affected by any structural factors in the image. Namely, the structures surrounding the individual pixels in the image are accurately ascertained, and weighted color difference information is collected along the direction in which the highest degree of similarity appears to manifest. As a result, unlike color difference information generated based upon the differences among pixels set along all directions without taking into consideration the specific image structure, the color difference information achieved in the sixth embodiment does not contain color difference information that is collected from a direction along which only a low degree of similarity manifests and may cause color artifacts. Consequently, the color index is not affected by any disturbance attributable to a structural factor in the image.

[0387] As a result, the luminance information, which greatly affects the visual perception, can be generated by using the correct type of similarity factors, i.e., the different color similarity factors or the same color similarity factors, and the image data can be converted and restored to a high-quality color image achieving a Nyquist frequency resolution and a resolution of saturated image areas. In addition, since the color difference planes are first generated and the color difference planes are used in the color evaluation based upon the results of which the luminance (G) plane is generated, the need for the unreliable color level calculation executed independently by using the Bayer plane in the related art is eliminated, and simple and high-speed processing is realized. Furthermore, since the color difference information corresponding to the color difference planes generated earlier is directly used in the image data output, it is not necessary to generate new color difference information and, as a result, the processing is executed faster.

SEVENTH EMBODIMENT

[0388] An algorithm that may be adopted to effectively process an image containing chromatic aberration of an optical system or an image manifesting abrupt color changes is explained in reference to the seventh embodiment. Since the structure of the electronic camera 1 achieved in the seventh embodiment is similar to that shown in the functional block diagram presented in FIG. 1 in reference to which the electronic camera corresponding to the first through fourth embodiments has been explained and its explanation is omitted. The explanation of the image conversion processing executed in the seventh embodiment focuses on the difference from the image conversion processing achieved in the sixth embodiment.

[0389] The flowchart of the overall image data conversion processing executed by the image processing unit 11 in the seventh embodiment would be similar to that presented in FIG. 22 in reference to which the sixth embodiment has been described. However, details of the G plane generation executed in step S4 and the GCrCb plane output executed in step S5 differ from those of the sixth embodiment. While the G plane generation executed in step S4 is identical to (3 G plane generation) in the sixth embodiment up to (3-1 Vertical/horizontal judgment 2) and (3-2 Directional index selection), it differs from the sixth embodiment in (3-3 G calculation) in which the luminance information G is generated by taking into consideration the diagonal similarity. Accordingly, the seventh embodiment includes an additional processing operation (3-3 Diagonal judgment) executed prior to (3-4 G calculation).

[0390]FIG. 25 is a block diagram illustrating the relationship among different types of processing executed in the seventh embodiment. It differs from the block diagram illustrating the processing in the sixth embodiment in that a diagonal judgment 201 is added and in that an output DN resulting from the diagonal judgment 201, an output HV of the selector 106 and the results BW of the color evaluation 104 are connected to a luminance generation 202, so that an even finer direction judgment can be made by combining the diagonal judgment and the vertical/horizontal judgment and an appropriate arithmetic expression can be used in correspondence to the results of the finer judgment in the luminance generation (G calculation) 202. The results BW of the color evaluation 104 are connected to the luminance generation to be referenced in the selection of the expression so as to further improve the luminance resolution even at image portions for which a definite direction judgment cannot be made. The following is a detailed explanation of the processing.

[0391] The (3 G plane generation) is achieved as follows in the seventh embodiment. (3 G plane generation) (3-1 Vertical/horizontal judgment 2) (3-1-1 Calculation of similarity factors) (3-1-1-1 Same color similarity factors) (3-1-1-2 Peripheral additions of similarity factors (3-1-2 Similarity judgment) (3-2 Directional index selection) (3-3 Diagonal judgment) (3-3-1 Calculation of similarity factors) (3-3-1-1 Similarity factors) (3-3-1-2 Peripheral additions of similarity factors) (3-3-2 Similarity judgment) (3-4 G calculation) The explanation is as follows. (3-3 Diagonal judgment) (3-3-1 Calculation of similarity factor) (3-3-1-1 Similarity factors)

[0392] The similarity manifesting along diagonal directions is judged by using pixel information available within a local area containing the target pixel for each R or B pixel present in the pre-conversion RGB image data. The diagonal directions include a diagonal 45° direction and a diagonal 135° direction. In FIG. 14, [HV,DN]=[0,1] indicates the diagonal 45° direction and [HV,DN]=[0,−1] indicates the diagonal 135° direction. A further explanation is to be provided later in reference to FIG. 14. [x,y] indicates the coordinates of a given pixel and the coordinates of the conversion target pixel are indicated as [i,j]. Color information present at a G pixel is indicated as G[x,y], color information present at an R pixel is indicated as R[x,y], color information present at a B pixel is indicated as B[x,y] and color information present at either an R pixel or a B pixel is summarily indicated as Z[x,y].

[0393] First, a BR (RB) similarity factor component C45 _(—)1 along the diagonal 45° direction, a BR (RB) similarity factor component C135 _(—)1 along the diagonal 135° direction, a GG similarity factor component C45 _(—)2 along the diagonal 45° direction, a GG similarity factor component C135 _(—)2 along the diagonal 135° direction, a BB (RR) similarity factor component C45 _(—)3 along a diagonal 45° direction and a BB (RR) similarity factor component C135 _(—)3 along the diagonal 135° direction are respectively determined by using expression (140), expression (141), expression (142), expression (143), expression (144) and expression (145).

BR (RB) Similarity Factor Components C 45 _(—)1=(|Z[i+1,j−1]−Z[i,j]|+|Z[i−1,j+1]−Z[i,j]|)/2   (140)

C 135 _(—)1=(|Z[i−1,j−1]−Z[i,j]|+|Z[i+1,j+1]−Z[i,j]|)/2   (141)

GG Similarity Factor Components C 45 _(—)2=(|G[i,j−1]−G[i−1,j]|+|G[i+1,j]−G[i,j+1]|)/2   (142)

C 135 _(—)2=(|G[i,j−1−G[i+1,j]|+|G[i−1,j]−G[i,j+1]|)/2   (143)

BB (RR) Similarity Factor Components C 45 _(—)3=|Z[i+1,j−1]−Z[i−1,j+1]|  (144)

C 135 _(—)3=(|Z[i−1,j−1]−Z[i+1,j+1]|  (145)

[0394] As the BR (RB) similarity factor components, similarity factors each indicating the similarity manifesting between the target pixel [i,j] and different color pixels set along a diagonal direction are calculated, as the GG similarity factor components, similarity factors each indicating the similarity between G pixels set along a diagonal direction around the target pixel are calculated, and as BB (RR) similarity factor components, similarity factors each indicating the similarity manifesting between same color pixels set on the two sides of the target pixel along a diagonal direction are calculated.

[0395] Using C45 _(—)1, C135 _(—)1, C45 _(—)2, C135 _(—)2, C45 _(—)3 and C135 _(—)3 obtained through the arithmetic operations executed as expressed in expressions (140) through (145) respectively, a 45° similarity factor C45 _(—)0[i,j] is obtained through expression (146) and a 135° similarity factor C135 _(—)0[i,j] is determined through expression (147). It is to be noted that constants a1, a2 and a3 may assume such values that satisfy a1=a2=a3=1, or a1=a2=2 and a3=1.

C 45 _(—)0[i,j]=(a1*C 45 _(—)1+a2*C 45 _(—)2+a3*C 45 _(—)3)/(a1+a2+a3)   (146)

C 135 _(—)0[i,j]=(a1*C 135 _(—)1+a2*C 135 _(—)2+a3*C 135 _(—)3)/(a1+a2+a3)   (147)

[0396] The 45° similarity factor C45 _(—)0[x,y] and the 135° similarity factor C135 _(—)0[x,y] are determined for the R pixels and the B pixels present in the target area in the pre-conversion RGB image data.

3-3-1-2 Peripheral Additions of Similarity Factors

[0397] Next, peripheral additions of similarity factors are executed. During this process, the arithmetic operations defined in expressions (103) and (104) are executed by using the 45° similarity factors C45 _(—)0[x,y] and the 135° similarity factors C135 _(—)0[x,y] calculated as explained above. The objective of these peripheral additions is to improve the accuracy of the similarity factors by taking into consideration the continuity with the surrounding pixels, as in the case of the vertical and horizontal similarity factors. It is to be noted that the peripheral additions may be skipped if priority is to be given to simplicity and higher processing speed.

[0398]C 45 [i,j]=(4*C 45 _(—)0[i,j]+2*(C 45 _(—)0[i−1,j−1]+C 45 _(—)0[i+1,j−1]+C 45 _(—)0[i−1,j+1]+C 45 _(—)0[i+1,j+1])+C 45 _(—)0[i,j−2]+C 45 _(—)0[i,j+2]+C 45 _(—)0[i−2,j]+C 45 _(—)0[i+2,j])/16   (147)

[0399]C 135 [i,j]=(4*C 135 _(—)0[i,j]+2*(C 135 _(—)0[i−1,j−1]+C 135 _(—)0[i+1,j−1]+C 135 _(—)0[i−1,j+1]+C 135 _(—)0[i+1,j+1])+C 135 _(—)0[i,j−2]+C 135 _(—)0[i,j+2]+C 135 _(—)0[i−2,j]+C 135 _(—)0[i+2,j])/16   (147)

3-3-2 Similarity Judgment

[0400] Next, the similarity judgment is executed. In this process, a specific manner with which the conversion target pixel manifests similarity is judged by using C45[i,j] and C135[i,j] determined as described above. In this example, a judgment is made as to whether marked similarity manifests along the diagonal 45⁰direction or along the diagonal 135° direction, or if it is not possible to identify either the 45° direction or the 135° direction as the specific direction along which marked similarity manifests. More specifically, if condition (148) is satisfied, it is judged that specific diagonal 45°/diagonal 135° similarity cannot be ascertained and 0 is set for a directional index DN[i,j]. Th2 is a predetermined threshold value assuming a value substantially equal to the value assumed for Th0 and Th1 used in the vertical/horizontal judgment, e.g., approximately 10 when there are 256 gradations. If the difference between the diagonal 45° similarity factor and the diagonal 135° similarity factor is equal to or smaller than the threshold value Th2, the judgment as to whether marked similarity manifests along the diagonal 45° direction or along the diagonal 135° direction cannot be made.

|C 45 [i,j]−C 135 [i,j]|≦Th2   (148)

[0401] If condition (148) is not satisfied, i.e., if it is judged that a marked similarity manifests along either the diagonal 45° direction or the diagonal 135° direction, a judgment is then made as to whether or not condition (149) is satisfied. If condition (149) is satisfied, it is determined that a marked similarity manifests along the diagonal 45° direction and 1 is set for the directional index DN[i,j]. If, on the other hand, condition (149) is not satisfied, it is determined that a marked similarity manifests along the diagonal 135° direction and −1 is set for the directional index DN[i,j]. It is to be noted that the smaller the values of the similarity factors C45[i,j] and C135[i,j], the higher degrees of similarity are indicated.

C45[i,j]<C135[i,j]  (149)

[0402] Values of the directional index DN[x,y] are calculated for all the R pixels and B pixels present in the target area in the pre-conversion RGB image data.

3-4 G Calculation

[0403] Based upon the vertical/horizontal directional index HV[i,j] and the diagonal directional index DN[i,j] set as explained above, luminance information G, i.e., G[i,j], is obtained for each pixel [i,j] corresponding to an R pixel or a B pixel in the pre-conversion RGB image data. Namely, color information corresponding to the G color component missing at the R pixels and the B pixels is obtained through interpolation processing. Depending upon the specific combination of the vertical/horizontal directional index HV[i,j] and the diagonal directional index DN[i,j], the directionality of the similarity can be identified as one of the following 9 types. FIG. 14 used in the explanation of the first embodiment should be referred to again. FIG. 14 shows varying directional index [HV,DN]. It is to be noted that the directional index [0,0] indicates that no similarity manifests along any of the vertical, horizontal and diagonal directions (i.e., an isolated point), or that similarity manifests along all the directions (i.e., part of a flat image area).

[0404] Based upon the directional index [HV, DN], i.e., based upon the specific directionality of the similarity, one of the following expressions (150) through (159) is selected and G[i,j] is calculated by using the selected expression. It is to be noted that if the directional index is [0,0], the expression is selected by further taking into consideration the color index BW[i,j] having been determined through (2-3 Color judgment). However, the color index does not need to be factored in if priority is to be given to simplicity. If BW[i,j]=“z”, i.e., if the results of the color judgment indicate a fully achromatic image portion, expression (150) is used instead of expression (151) since the correctional terms, i.e., the second and subsequent terms, in expressions (160) and (163), constituting expression (151), achieve correction over 2-pixel pitches and an image such as a black-and-white Nyquist check pattern cannot be accurately corrected through an expression (151). In other words, by selectively using either expression (150) or (151), the addition ratio or the composite ratio of the color information present at the target pixel and the color information at nearby pixels is adjusted based upon the color index BW[i,j]. FIG. 26 shows the positions of the pixels used in the processing in correspondence to the directional index and the color components corresponding to the pixels when the conversion target pixel is an R pixel.

[0405] When the directional index is [0,0] and BW[i,j]=“z”; expression (150) is used.

[0406] When the directional index is [0,0] and BW[i,j]≠“z”; expression (151) is used.

[0407] When the directional index is [0,1]; expression [152) is used.

[0408] When the directional index is [0,−1]; expression (153) is used.

[0409] When the directional index is [1,0]; expression (154) is used.

[0410] When the directional index is [1,1]; expression (155) is used.

[0411] When the directional index is [1,−1]; expression (156) is used.

[0412] When the directional index is [−1,0]; expression (157) is used.

[0413] When the directional index is [−1,1]; expression (158) is used.

[0414] When the directional index is [−1,−1]; expression (159) is used.

G[i,j]={Z[i,j]+(Gv+Gh)/2}/2   (150)

G[i,j]=(Gv+Gh)/2   (151)

G[i,j]=(Gv 45 +Gh 45)/2   (152)

G[i,j]=(Gv 135 +Gh 135)/2   (153)

G[i,j]=Gv   (154)

G[i,j]=Gv45   (155)

G[i,j]=Gv135   (156)

G[i,j]=Gh   (157)

G[i,j]=Gh45   (158)

G[i,j]=Gh135   (159)

[0415] Gv, Gh, Gv45, Gh45, Gv135 and Gh135 above should be determined through arithmetic operations executed as expressed in the following expressions (160) through (165).

[0416]Gv=(G[i,j−1]+G[i,j+1])/2+(2*Z[i,j]−Z[i,j−2]−Z[i,j+2])/8+(2*G[i−1,j]−G[i−1,j−2]−G[i−1,j+2]+2*G[i+1,j]−G[i+1,j−2]−G[i+1,j+2])/16   (160)

[0417]Gv 45=(G[i,j−1]+G[i,j+1])/2+(2*Z[i,j]−Z[i,j −2]−Z[i,j+2])/8+(2*Z[i−1,j+1]−Z[i−1,j−1]−Z[i−1,j+3]+2*Z[i+1,j−1]−Z[i+1,j−3]−Z[i+1,j+1])/16   (161)

[0418]Gv 135=(G[i,j−1]+G[i,j+1])/2+(2*Z[i,j]−Z[i,j−2]−Z[i,j+2])/8+(2*Z[i−1,j−1]−Z[i−1,j−3]−Z[i−1,j+1]+2*Z[i+1,j+1]−Z[i+1,j−1]−Z[i+1,j+3])/16   (162)

[0419]Gh=(G[i−1,j]+G[i+1,j])/2+(2*Z[i,j]−Z[i−2,j]−Z[i+2,j])/8+(2*G[i,j−1]−G[i−2,j−1]−G[i+2,j−1]+2*G[i,j+1]−G[i−2,j+1]−G[i+2,j+1])/16   (163)

[0420]Gh 45=(G[i−1,j]+G[i+1,j])/2+(2*Z[i,j]−Z[i−2,j]−Z[i+2,j])/8+(2*Z[i+1,j−1]−Z[i−1,j−1]−Z[i+3,j−1]+2*Z[i−1,j+1]−Z[i−3,j+1]−Z[i+1,j+1])/16   (164)

[0421]Gh 135=(G[i−1,j]+G[i+1,j])/2+(2*Z[i,j]−Z[i−2,j]−Z[i+2,j])/8+(2*Z[i−1,j−1]−Z[i−3,j−1]−Z[i+1,j−1]+2*Z[i+1,j+1]−Z[i−1,j+1]−Z[i+3,j+1])/16   (165)

[0422] expressions (160) through (165) are now explained.

[0423] Assuming that an R pixel is undergoing the processing, the first set of parentheses can be regarded to represent a G color component average term, the second set of parentheses can be regarded to represent an R color component correctional term and the third set of parentheses can be regarded to represent a B (G) component correctional term in each expression. While there is a possibility of the R color component correctional term inducing an over-correction along the gradation direction in an image area where the color fluctuates drastically, the B (G) component correctional term working as opposite phase along gradation direction prevents such an over-correction in this embodiment. In addition, while the R color component correctional term is caused to shift spatially if there is a chromatic aberration, the B (G) component correctional term, too, shifts along the direction toward the opposite phase of the R color component correctional term to cancel it out, thereby preventing any adverse effect of the chromatic aberration from manifesting.

[0424] When there is a possibility of an image portion for which any directional similarity cannot be identified with the directional index [HV,DN] set to [0,0] being assumed to be a fully achromatic image portion through the color evaluation and the image undergoing the processing is a Nyquist frequency level check pattern, even the check pattern can be resolved by adjusting the contribution ratio of the central pixel and the surrounding pixels set for the G color component generation.

[0425] As a result, image data can be converted and restored to a high-quality color image achieving both outstanding Nyquist frequency resolution and outstanding resolution in saturated image areas in the seventh embodiment. In addition, even an image with drastic color changes or an image containing chromatic aberration in an optical system can be converted and restored to a color image with a high degree of tolerance. Furthermore, it has been verified that the processing can be achieved as software processing executed with satisfactory speed.

EIGHTH EMBODIMENT

[0426] In the sixth and seventh embodiments, the G plane generation is achieved by adopting the concept of interpolation processing. In the eighth embodiment, on the other hand, luminance information is generated through a method different from that adopted in the sixth and seventh embodiments.

[0427] Since the structure of the electronic camera 1 achieved in the eighth embodiment is similar to that shown in the functional block diagram presented in FIG. 1 in reference to which the electronic camera corresponding to the first through fourth embodiments has been explained and its explanation is omitted. FIG. 27 presents a schematic flowchart of the image data conversion processing executed by the image processing unit 11 in the eighth embodiment. The processing executed in steps S1 through S3 is identical to that executed in the corresponding steps in the sixth embodiment as shown in FIG. 22. The Y-plane generation executed in step S14 and the YCrCb plane output executed in step S15 differentiate the eighth embodiment from the sixth embodiment. Namely, the G plane generation executed in step S4 in the sixth and seventh embodiments is replaced with the Y plane generation executed in step S14 in the eighth embodiment and the GCbCr plane output executed in step S5 in the sixth and seventh embodiments it is replaced with the YCbCr plane output executed in step S15 in the eighth embodiment. FIG. 21(b) illustrates the concept of the conversion.

[0428] It is to be noted that (3-1 Vertical/horizontal judgment 2), (3-2 Directional index selection) and (3-3 Diagonal judgment) executed in (3 G plane generation) in the seventh embodiment as explained earlier are also executed in the Y plane generation in step S14 in the eighth embodiment. Accordingly, an explanation is given on (Y calculation) and (Edge enhancement) executed as additional processing, which differentiate the eighth embodiment from the seventh embodiment. An explanation is also provided on the YCbCr plane output, i.e., (Color image output). The block diagram showing the relationship among the various types of processing executed in the eighth embodiment would be similar to that presented in FIG. 25 to facilitate the explanation of the seventh embodiment.

[0429] (3 Y plane generation) and (4 Color image output) are executed in the eighth embodiment, as indicated below. (3 Y plane generation) (3-1 Vertical/horizontal judgment) (3-1-1 Calculation of similarity factors) (3-1-1-1 Same color similarity factors) (3-1-1-2 Peripheral additions of similarity factors) (3-1-2 Similarity judgment) (3-2 Directional index selection) (3-3 Diagonal judgment) (3-3-1 Calculation of similarity factors) (3-3-1-1 Similarity factors) (3-3-1-2 Peripheral additions of similarity factors) (3-3-2 Similarity judgment) (3-4 Y calculation) (3-5 Edge enhancement) (4 Color image output) (3-4 Y calculation)

[0430] Luminance information Y is calculated in the eighth embodiment by generating a luminance Y plane through a direct weighted addition of the Bayer plane, instead of through the G plane generation executed in the sixth and seventh embodiments. Namely, the luminance information Y is directly generated by using the color information corresponding to the individual color components constituting the pre-conversion RGB image data that have not yet undergone the interpolation processing. A given set of color information in the pre-conversion RGB image data (Bayer plane data) is indicated as A[x,y].

[0431] Based upon the vertical/horizontal directional index HV[i,j] and the diagonal directional index DN[i,j] set as described earlier, luminance information Y, i.e., Y[i,j], is obtained for each pixel [i,j] corresponding to an R pixel or a B pixel in the pre-conversion RGB image data. Depending upon the specific combination of the vertical/horizontal directional index HV[i,j] and the diagonal directional index DN[i,j], the directionality of the similarity can be identified as one of the following 9 types, as in the seventh embodiment (see FIG. 14).

[0432] Based upon the directional index [HV,DN], i.e., based upon the specific directionality of the similarity, one of the following expressions (170) through (179) is selected and Y[i,j] is calculated by using the selected expression. It is to be noted that if the directional index is [0,0], the expression is selected by a further taking into consideration the color index BW[i,j] having been determined through (2-3 Color judgment), as in the seventh embodiment. However, the color index does not need to be factored in if priority is to be given to simplicity.

[0433] If the conversion target pixel [i,j] is a G pixel, expression (170) is used, whereas if the conversion target pixel [i,j] is not a G pixel, one of expressions (171) through (180) is selected and used in correspondence to the specific directional index setting as indicated below. It is to be noted that FIG. 28 shows the positions of the pixels used in the processing when the conversion target pixel is a G pixel and the coefficient set for the pixels (G-positioned luminance generation coefficient pattern). FIG. 29 shows the positions of the pixels used in the processing in correspondence to different directional index settings when the conversion target pixel is a R pixel or a B pixel and the coefficients set for the pixels (R and B-positioned luminance generation coefficient patterns).

[0434] When the directional index is [0,0] and BW[i,j]=“z”; expression (171) is used.

[0435] When the directional index is [0,0] and BW[i,j]≠“z”; expression (172) is used.

[0436] When the directional index is [0,1]; expression (173) is used.

[0437] When the directional index is [0,−1]; expression (174) is used.

[0438] When the directional index is [1,0]; expression (175) is used.

[0439] When the directional index is [1,1]; expression (176) is used.

[0440] When the directional index is [1,−1]; expression (177) is used.

[0441] When the directional index is [−1,0]; expression (178) is used.

[0442] When the directional index is [−1,1]; expression (179) is used.

[0443] When the directional index is [−1,−1]; expression (180) is used.

Y[i,j]=Y_(G)   (170)

Y[i,j]=Y_(RB)UNIa   (171)

Y[i,j]=Y_(RB)UNIb   (172)

Y[i,j]=Y_(RB)45   (173)

Y[i,j]=Y_(RB)135   (174)

Y[i,j]=Y_(RB)v   (175)

Y[i,j]=Y_(RB)v45   (176)

Y[i,j]=Y_(RB)v135   (177)

Y[i,j]=Y_(RB)h   (178)

Y[i,j]=Y_(RB)h45   (179)

Y[i,j]=Y_(RB)h135   (180)

[0444] Y_(G), Y_(RB)UNIa, Y_(RB)UNIb, Y_(RB)45, Y_(RB)135, Y_(RB)v45, Y_(RB)v135, Y_(RB)h, Y_(RB)h45 and Y_(RB)h135 above should be determined through arithmetic operations executed as expressed in the following expressions (181) through (191)

[0445]Y _(G) =α*A[i,j]+(β/4)*{A[i−1,j]+A[i+1,j]+A[i,j−1]+A[i,j+1]}  (181)

[0446]Y _(RB) UNIa=p*A[i,j]+q*Y _(RB) UNIb   (182)

[0447]Y _(RB) UNIb=(β/2)*A[i,j]+α*{(v1/2)*A[i−1,j]+(v2/2)*A[i+1,j]+(u1/2)*A[i,j−1]+(u2/2)*A[i,j+1]}+(β/2)*{(s1/2)*A[i−1,j−1]+(s2/2)*A[i+1,j+1]+(t1/2)*A[i+1,j−1]+(t2/2)*A[i−1,j+1]}  (183)

[0448]Y _(RB)45=(β/2)*A[i,j]+α*{(v1/2)*A[i−1,j]+(v2/2)*A[i+1,j]+(u1/2)*A[i,j−1]+(u2/2)*A[i,j+1]}+(β/2)*{t1*A[i+1,j−1+t2*A[i−1,j+1]}  (184)

[0449]Y _(RB)135=(β/2)*A[i,j]+α*{(v1/2)*A[i−1,j]+(v2/2)*A[i+1,j]+(u1/2)*A[i,j<1]+(u2/2)*A[i,j+1]}+(β/2)*{s1*A[i−1,j−1]+s2*A[i+1,j+1]}  (185)

[0450]Y _(RB) v=(β/2)*A[i,j]+α*{u1*A[i,j−1]+u2*A[i,j+1]}+(β/2)*{(s1/2)*A[i−1,j−1]+(s2/2)*A[i+1,j+1]+(t1/2)*A[i+1,j−1]+(t2/2)*A[i−1,j+1]}  (186)

[0451]Y _(RB) v45=(β/2)*A[i,j]+α*{u1*A[i,j−1]+u2*A[i,j+1]}+(β/2)*[t1*A[i+1,j−1]+t2*A[i−1,j+1]}  (187)

[0452]Y _(RB) v135=(β/2)*A[i,j]+α*{u1*A i,j−1]+u2*A[i,j+1]}+(β/2)*{s1*A[i−1,j1]+s2*A[i+1,j+1]}  (188)

[0453]Y _(RB) h=(β/2)*A[i,j]+α*{v1*A[i−1,j]+v2*A[i+1,j]}+(β/2)*{(s1/2)*A[i−1,j−1]+(s2/2)*A[i+1,j+1]+(t1/2)*A[i+1,j−1]+(t2/2)*A[i−1,j+1]}  (189)

Y _(RB) h45=(β/2)*A[i,j]+α*{v1*A[i−1,j]+v2*A[i+1,j]}+(β/2)*{t1*A[i+1,j−1]+t2*A[i−1,j+1]}  (190)

Y _(RB) h135=(β/2)*A[i,j]+α*{v1*A[i−1,j]+v2*A[i+1,j]}+(β/2)*{s1*A[i−1,j−1]+s2*A[i+1,j+1]}  (191)

[0454] It is to be noted that the following restrictions (192) are imposed on the constants (coefficients) used in the expressions. In addition, these constants each assume a positive value or the value of zero.

α+β=1,p+q=1,u1+u2=1,v1+v2=1,s1+s2=1,t1+t2=1   (192)

[0455] An example of the settings for the constants generally deemed desirable it is presented below.

u1≈u2,v1≈v2,s1≈s2,t1≈t2

(α,β)=(1/3,2/3),(4/9,5/9),(5/11,6/11),(1/2,1/2),(5/9,4/9),(3/5,2/5),(2/3,1/3)

(p,q)=(1/3,2/3),(1/2,1/2)

[0456] The constants α and β are parameters used to determine the ratio of the R data, the G data and the B data in the luminance information and they satisfy a relationship expressed as Y=α * G+β *(R+B)/2. The constants p and q are parameters used to adjust the color information composite ratio of the central pixel and the nearby pixels contained in the luminance value, whereas Y_(RB)UNIa is used to resolve a Nyquist frequency check pattern.

3-5 Edge Enhancement

[0457] On the Y plane described above, an image that retains fine image structures of the original image intact and achieves a very smooth continuity is formed. For this reason, the edge enhancement processing can be achieved simply by applying a basic fixed filter which does not require that directionality be taken into consideration. The filter used for the edge enhancement may be a laplacian filter defined in expression (193) and illustrated in FIG. 30. Then, the ultimate luminance information Y is obtained through an arithmetic operation expressed in expression (194). The constant K in expression (194) assumes a positive value and is normally set to a value equal to or greater than 1.

YH[i,j]={8*Y[i,j]−(Y[i−1,j]+Y[i+1,j]+Y[i,j−1]+Y[i,j+1]Y[i−1,j−1]+Y[i+1,j−1]+Y[i−1,j+1]+Y[i+1,j+1]}/16   (193)

Y[i,j]=Y[i,j]+K*YH[i,j]  (194)

4 Color Image Output

[0458] With Cr[i,j], Cb[i,j] and Y[i,j] ascertained for each pixel through the processing described above, color image data in the YCrCb colorimetric system are generated. Subsequently, various types of image processing including certain color difference correction processing may be implemented. In addition, if the YCbCr image data need to be converted to image data in the RGB colorimetric system, arithmetic operations should be executed as defined in the following expressions (195) through (197). Through such arithmetic operations, image data in the RGB colorimetric system with color information corresponding to all the color components, R, G and B present at each pixel in the target area can be generated.

R[i,j]=Y[i,j]+(1−β/2)*Cr[i,j]−(β/2)*Cb[i,j]  (195)

G[i,j]=Y[i,j]−(β/2)*Cr[i,j]−(β/2)*Cb[i,j]  (196)

B[i,j]=Y[i,j]−(β/2)*Cr[i,j]+(1−β/2)*Cb[i,j]  (197)

[0459] In the eighth embodiment, too, image data constituting any of various types of images including an image that contains chromatic aberration can be converted and restored to a high-quality color image achieving both an outstanding Nyquist frequency resolution and an outstanding resolution in saturated image areas through the luminance plane generation achieved based upon the results of an accurate direction judgment. Furthermore, it has been verified that the processing can be achieved as software processing executed with a satisfactory speed in the eighth embodiment, as well.

NINTH EMBODIMENT

[0460] In the ninth embodiment, a color difference correction 2, which differs from the color difference correction 1 in the sixth embodiment is executed in addition to the color difference correction 1 executed in the sixth embodiment, and either of the two different types of color differences resulting from the two different corrections is selectively used as the color difference plane to be ultimately output based upon the results of the color judgment. As a result, a color difference plane without significant color artifacts and achieving faithful color reproduction can be generated separately from the luminance plane.

[0461] Since the structure of the electronic camera 1 achieved in the ninth embodiment is similar to that shown in the functional block diagram presented in FIG. 1 in reference to which the electronic camera corresponding to the first through fourth embodiments has been explained and its explanation is omitted. FIG. 31 presents a schematic flowchart of the image data conversion processing executed by the image processing unit 11 in the ninth embodiment. The processing executed in steps S1, S3 and steps S4 and S5 is identical to that executed in the corresponding steps in the sixth embodiment, as shown in FIG. 22. However, a new step S21 executed for Cr and Cb plane selection is inserted between step S3 and step S4 in the ninth embodiment.

[0462]FIG. 32 is a block diagram provided to facilitate an explanation of the relationship among various types of processing executed in the ninth embodiment. The aspects of the processing corresponding to the Bayer plane 101, the color difference generation 102, the vertical/horizontal judgment 103 and the color evaluation 104 in FIG. 23 provided as reference to the sixth embodiment are extracted and shown in the figure. The color difference correction 1 which is executed as part of the color evaluation 104 in the sixth embodiment is extracted and indicated as a separate color difference correction 1 (301), a new color difference correction 2 (302) is added and outputs TCr1 and TCb1 of the color difference correction 1 (301) and outputs TCr2 and TCb2 of the color difference correction 2 (302) are connected to a selector (303), so as to select the desirable color difference correction, i.e., the color difference correction 1 (301) or the color difference correction 2, based upon the results BW of the color evaluation 104.

[0463] The following is an explanation of the newly added processing, i.e., the Cr and Cb plane selection. The image conversion processing is executed as indicated below in the ninth embodiment. It differs from the processing in the sixth embodiment in that (3 Cr and Cb plane selection) is executed before (4 G plane generation). (1 Cr and Cb plane generation) (2 Color evaluation) (2-1 Color difference correction 1) (2-2 Color index calculation) (2-3 Color judgment) (3 Cr and Cb plane selection) (3-1 Color difference correction 2) (3-2 Color difference selection) (4 G plane generation) (5 Color image output) (3 Cr and Cb plane selection) (3-1 Color difference correction 2)

[0464] The low-pass filter (see FIG. 24) used in (2-1 Color difference correction 1) in (2 Color evaluation) executed as in the sixth embodiment is a wide range filter which is highly affective as a means for minimizing the occurrence of color artifacts and also as a means for color evaluation. However, the color difference planes ultimately output do not exactly achieve a satisfactorily faithful color reproduction in fine color pattern areas. Accordingly, another low-pass filter, i.e., a narrow range low-pass filter, which achieves excellent color reproduction capability for fine color patterns while it does not have superior color artifact reducing capability, is used in the ninth embodiment. More specifically, the color difference correction 2 is executed by using expression (200). FIG. 33 illustrates this narrow range low-pass filter. However, a expression other than expression (200) may instead be used for a lesser low-pass filtering effect, or the data may be allowed to be filtered through without any processing.

TCr 2[i,j]={4* Cr[i,j]+2*(Cr[i−1,j]+Cr[i+1,j]+Cr[i,j−1]+Cr[i,j+1])+1*(Cr[i−1,j−1]+Cr[i+1,j−1]+Cr[i−1,j+1]+Cr[i+1,j+1])}/16   (200)

[0465] TCb2[i,j] is calculated through a similar expression.

3-2 Color Difference Selection

[0466] Next, based upon the results of the color judgment, more reliable color difference planes are selected from the two types of color difference planes achieved through the correction processing executed by adopting the two different methods. More specifically, when BW[i,j]≠“c”, TCr1[i,j] and TCb1[i,j] are respectively selected for Cr[i,j] and Cb[i,j]. When BW[i,j]=“c”, TCr2[i,j] and TCb2[i,j] are respectively selected for Cr[i,j] and Cb[i,j].

[0467] Namely, when the results of the color evaluation indicate a lightly saturated image portion or an achromatic image portion, the wide-range low-pass filter with the superior color artifact reducing capability is used, whereas when the results of the color evaluation indicate intense color, the narrow range low-pass filter that achieves excellent color reproduction in fine color pattern areas while slightly lacking in the color artifact reducing capability is used. As a result, color difference planes achieving highly faithful color reproduction in which hardly any color artifacts manifests, can be generated through independent color difference plane processing. Furthermore, the ninth embodiment achieves a simplicity that greatly facilitates a hardware application thereof. It is to be noted that the ninth embodiment may be regarded as a variation of the sixth embodiment, in which the color difference planes are more adaptively processed. This concept may be adopted in the processing executed in the seventh embodiment and the processing executed in the eighth embodiment, as well.

[0468]FIG. 34 provides a summarized chart illustrating the utilization of the color index determined through the color evaluation executed in the sixth through ninth embodiments as explained above. FIG. 34(a) is provided to facilitate an explanation of the color index BW obtained through the color evaluation in the various embodiments. The image portion becomes more achromatic toward the left side of the figure, whereas its color becomes more intense, i.e., its saturation, hue and color intensity increase, toward the right side.

[0469]FIG. 34(b) indicates that the rate at which the information at the central pixel (target pixel) is used in the luminance information generation is increased when the target image portion is judged to be fully achromatic. For instance, when the directional index is [0,0] and BW[i,j]=“z”, expression (150) is used and when the directional index is [0,0] and BW[i,j]≠“z”, expression (151) is used in the seventh embodiment.

[0470]FIG. 34(c) indicates that either the different color similarity factors or the same color similarity factors are selectively used in the similarity direction judgment depending upon the results of the color evaluation in the sixth through ninth embodiments. If the results of the color evaluation indicate an achromatic color, the different color similarity factors are used, whereas if the results indicate a chromatic image portion, the same color similarity factors are used.

[0471]FIG. 34(d) indicates that either the wide-range low-pass filter or the narrow range low-pass filter is selectively used in the color difference correction based upon the results of the color evaluation.

[0472] It is to be noted that while an explanation is given above in reference to the embodiments on an example in which an image in the RGB colorimetric system is converted to an image (in the GCbCr colorimetric system or the YCbCr colorimetric system) constituted of color differences (chrominance) and luminance information, the present invention is not limited to this example. It may instead be adopted to convert an image expressed in another colorimetric system to an image constituted of color differences and luminance information as well. In addition, it may be adopted to convert an image in the RGB colorimetric system through interpolation processing without switching into another colorimetric system.

[0473] While an explanation is given above in reference to the embodiments on an example in which the present invention is adopted in conjunction with the RGB colorimetric system with pixels arranged in a Bayer array, the present invention is not limited to this example and it may be adopted in combination with color filters arranged in another type of array.

[0474] Furthermore, the specific expressions used in the similarity judgment in the individual embodiments do not necessarily restrict the mode of implementation. In other words, the similarity judgment may be executed by using other appropriate expressions. The specific expressions used in the luminance information calculation in the individual embodiments do not necessarily restrict the mode of implementation either. In other words, the luminance information generation may be executed by using other appropriate expressions.

[0475] While a low-pass filter (see FIGS. 24 and 33) is used in a color difference correction and a band pass filter (see FIG. 30) is used for edge enhancement in the embodiments described above, the present invention is not limited to these details and it may be adopted in conjunction with a low-pass filter and a band pass filter assuming different structures.

[0476] While the processing is executed in units of individual target areas constituting the image data in the embodiments described above, the present invention is not limited to this example. For instance, the present invention may be adopted in processing executed in units of single pixels or individual pixel groups each constituted of several pixels, or in processing executed over an entire image.

[0477] In addition, while the present invention is adopted in an electronic camera in the embodiments described above, the present invention is not limited to this example. It may instead be adopted in a video camera that captures dynamic or moving images or a personal computer or a portable telephone mounted with an image-capturing sensor. In other words, the present invention may be adopted in all types of apparatuses that generate color image data by employing an image-capturing sensor.

[0478] When the present invention is adopted in a personal computer or the like, the program that executes the processing described above may be provided in a recording medium such as a CD-ROM or through a data signal on the Internet or the like. FIG. 35 shows how this may be achieved. A personal computer 400 receives the program via a CD-ROM 404. The personal computer 400 can be connected to a communication line 401. A computer 402 is a server that provides the program stored in a recording medium such as a hard disk 403. The communication line 401 may be a communication line used for an Internet communication, personal computer communication or the like, or it maybe a dedicated communication line. The computer 402 reads out the program from the hard disk 403 and transmits the program to the personal computer 400 via the communication line 401. In other words, it transmits the program via the communication line 401 as a data signal on a carrier wave. Thus, the program can be provided as a computer-readable computer program product adopting any of various modes such as a recording medium and a carrier wave. 

1. An image processing method for converting a first image that is expressed in a colorimetric system made up of a plurality of color components and comprises a plurality of pixels each having color information corresponding to one of the color components into a second image that comprises a plurality of pixels each having at least a common type of color information, comprising: a color judgment step that includes a color difference information generation step in which color difference information is generated for a processing target pixel in the second image by using color information in the first image through one of at least three different methods and a color evaluation step in which a color evaluation is individually executed for each of processing target pixels in the second image by using the color difference information; and an image conversion step in which the first image is converted to the second image based upon results of the color evaluation executed in the color-judgment step.
 2. An image processing method according to claim 1, wherein: the color judgment step further includes a similarity factor calculation step in which similarity factors corresponding to at least two directions are calculated for the processing target pixel in the second image by using the color information in the first image and a similarity judgment step in which a level of similarity manifesting along each direction is determined to be one of at least three levels based upon the similarity factors; and in the color difference information generation step, the color difference information is generated by using the color information in the first image through one of at least the three methods each corresponding to specific judgment results obtained in the similarity judgment step.
 3. An image processing method according to claim 1, wherein: the image conversion step includes 1) a similarity factor calculation step in which different color similarity factors each constituted of color information corresponding to different color components and same color similarity factors each constituted of color information corresponding to a single color component are calculated along at least two directions for the processing target pixel by using the color information in the first image, and similarity factors are obtained by selectively using either the different color similarity factors or the same color similarity factors based upon the results of the color evaluation; 2) a similarity judgment step in which levels of similarity manifesting along the individual directions are judged based upon the similarity factors; and 3) a second image generation step in which color information for the second image is generated by using the color information in the first image based upon judgment results obtained in the similarity judgment step.
 4. An image processing method according to claim 1, wherein: the image conversion step includes 1) a similarity factor calculation step in which different color similarity factors each constituted of color information corresponding to different color components and same color similarity factors each constituted of color information corresponding to a single color component are calculated along at least two directions for the processing target pixel by using the color information in the first image and similarity factors are calculated through weighted additions of the different color similarity factors and the same color similarity factors executed by varying a weighting ratio thereof based upon the results of the color evaluation; 2) a similarity judgment step in which levels of similarity manifesting along the individual directions are judged based upon the similarity factors; and 3) a second image generation step in which color information for the second image is generated by using the color information in the first image based upon judgment results obtained in the similarity judgment step.
 5. An image processing method according to claim 1, wherein: the image conversion step includes a second image generation step in which color information for the second image is generated by using color information present at a pixel in the first image corresponding to the processing target pixel and color information present at nearby pixels in the first image with a make-up ratio of the color information adjusted in conformance to the results of the color evaluation.
 6. An image processing method according to claim 1, wherein: the image conversion step includes 1) a second image generation step in which color difference information for the second image is generated by using the color information in the first image; and 2) a color difference information correction step in which the color difference information for the second image is corrected based upon the results of the color evaluation.
 7. An image processing method according to claim 1, wherein: 1) in color difference information generation step executed during the color judgment step, a plurality of types of color difference information are generated for a single processing target pixel; and 2) in the color evaluation step executed during the color judgment step, the color evaluation is executed by taking into consideration a new type of color difference information generated through a combination of the plurality of types of color difference information.
 8. An image processing method according to claim 2, wherein: in the similarity factor calculation step executed during the color judgment step, different color similarity factors each constituted of color information corresponding to different color components are calculated as similarity factors.
 9. An image processing method according to claim 1, wherein: in the color evaluation step executed during the color judgment step, the color evaluation is executed by incorporating color difference information generated for nearby pixels through the color difference information generation step with the color difference information generated for the processing target pixel.
 10. An image processing method according to claim 3 or claim 4, wherein: in the similarity factor calculation step executed during the image conversion step, the different color similarity factors are mainly used as the similarity factors when a saturation level is judged to be low in the color evaluation, and the same color similarity factors are mainly used as the similarity factors if the saturation level is judged to be high in the color evaluation.
 11. An image processing method according to claim 5, wherein: in the second image generation step executed during the image conversion step, the make-up ratio of the color information present at the pixel in the first image corresponding to the processing target pixel is raised if a saturation level is judged to be low in the color evaluation.
 12. An image processing method according to claim 5, wherein: the image conversion step includes prior to the second image generation step 1) a similarity factor calculation step in which similarity factors along at least two directions are calculated for the processing target pixel by using the color information in the first image, and 2) a similarity judgment step in which levels of similarity manifesting along the individual directions are judged based upon the similarity factors for the processing target pixel; and the make-up ratio is adjusted based upon the results of the color evaluation only if judgment results obtained through the similarity judgment step indicate substantially equal levels of similarity manifesting along the individual directions.
 13. An image processing method according to claim 6, wherein: in the color difference information correction step executed during the image conversion step, wide range filter processing is executed on the color difference information for the second image when a saturation level is judged to be low in the color evaluation, and narrow range filter processing is executed on the color difference information for the second image when the saturation level is judged to be high in the color evaluation.
 14. An image processing method according to claim 1, wherein: in the color evaluation step executed during the color judgment step, the color difference information is corrected and the color evaluation is executed by using the corrected color difference information.
 15. An image processing method according to claim 14, wherein: in the color evaluation step executed during the color judgment step, low-pass filter processing is executed to correct the color difference information.
 16. An image processing method according to claim 1, wherein: the color judgment step includes after the color evaluation step 1) a color difference information correction step in which the color difference information is corrected based upon the results of the color evaluation, and 2) a color re-evaluation step in which a color evaluation is re-executed in units of individual pixels by using the color difference information having been corrected through the color difference information correction step; and the first image is converted to the second image based upon results of the color evaluation executed in the color re-evaluation step.
 17. An image processing method according to claim 16, wherein: the color judgment step includes prior to the color difference information correction step 1) a luminance information calculation step in which luminance information is calculated by using the color information in the first image; and 2) a luminance evaluation step in which a luminance evaluation is executed in units of individual pixels by using the luminance information; and in the color difference information correction step, the color difference information is corrected based upon the results of the color evaluation executed in the color re-evaluation step and results of the luminance evaluation executed in the luminance evaluation step.
 18. An image processing method according to claim 16, wherein: in the color difference information correction step executed during the color judgment step, median filter processing is executed on the color difference information.
 19. An image processing method for converting a first image that is expressed in a colorimetric system made up of a plurality of color components and comprises a plurality of pixels each having color information corresponding to one of the color components into a second image that comprises a plurality of pixels each having a plurality of types of color information, comprising: an image acquisition step in which the first image is obtained; a color difference information generation step in which color difference information is generated in correspondence to positions of the pixels constituting the second image based upon color information corresponding to the color components of the obtained first image; a color evaluation step in which a color evaluation is executed in units of individual pixels by using the generated color difference information for the second image; a luminance information generation step in which luminance information is generated in correspondence to the positions of the pixels constituting the second image based upon results of the color evaluation executed in units of the individual pixels of the second image; and an output step in which the second image is output by using the color difference information generated in the color difference information generation step and the luminance information generated in the luminance information generation step.
 20. An image processing method according to claim 19, wherein: the color difference information at the position of a given pixel of the second image comprises a plurality of types of color difference information; and in the color evaluation step, the color evaluation is executed by taking into consideration a new type of color difference information generated through a combination of the plurality of types of color difference information.
 21. An image processing method according to claim 20, wherein: the first image is expressed in a colorimetric system that is made up of a first color component, a second color component and a third color component, with pixels corresponding to the first color component set with a higher pixel density than pixels corresponding to the second color component or pixels corresponding to the third color component; the plurality of types of color difference information include first color difference information comprising a difference between color information corresponding to the first color component and color information corresponding to the second color component and second color difference information comprising a difference between the color information corresponding to the first color component and color information corresponding to the third color information; and the new type of color difference information comprises a difference between the first color difference information and the second color difference information.
 22. An image processing method according to any one of claims 19 through 21, wherein: in the color evaluation step, the generated color difference information for the second image is corrected and the color evaluation is executed by using the corrected color difference information.
 23. An image processing method according to claim 22, wherein: in the color evaluation step, the generated color difference information for the second image is corrected through low-pass filter processing.
 24. An image processing method according to any one of claims 19 through 23, further comprising: a similarity factor calculation step executed before the luminance information generation step, in which different color similarity factors indicating similarity manifesting between a pixel of the first image corresponding to a pixel of the second image and nearby pixels along at least two directions are calculated by using color information corresponding to different color components in a local area containing the pixel and same color similarity factors indicating similarity manifesting between the pixel and nearby pixels along at least the two directions are calculated by using color information corresponding to a single color component in the local area containing the pixel; and a similarity judgment step executed before the luminance information generation step and after the color evaluation step, in which levels of similarity manifesting along at least the two directions between the pixel of the first image corresponding to the pixel of the second image and the nearby pixels are judged by selectively using either the different color similarity factors or the same color similarity factors calculated in the similarity factor calculation step based upon the results of the color evaluation, wherein: in the luminance information generation step, the luminance information is generated in correspondence to the position of the pixel of the second image based upon judgment results obtained in the similarity judgment step.
 25. An image processing method according to any of claims 19 through 24, wherein: the plurality of pixels of the first image and the plurality of pixels of the second image correspond to each other in a positional arrangement.
 26. An image processing method according to claim 19, wherein: in the luminance information generation step, the luminance information is generated in correspondence to the position of a pixel of the second image by using color information at a pixel of the first image corresponding to the pixel of the second image and color information present at nearby pixels of the first image, and a make-up ratio of the color information present at the pixel of the first image corresponding to the pixel of the second image and the color information present at nearby pixels of the first image is adjusted based upon the results of the color evaluation executed in units of individual pixels constituting the second image.
 27. An image processing method according to claim 19, further comprising: a similarity judgment step executed before the color difference information generation step, in which levels of similarity manifesting between a pixel of the first image corresponding to a pixel of the second image and nearby pixels of the first image along at least two directions are judged by using color information present in a local area containing the pixel of the first image, wherein; in the color difference information generation step, color difference information is generated in correspondence to a position of the pixel of the second image based upon judgment results obtained through the similarity judgment step.
 28. An image processing method according to claim 27, wherein: in the similarity judgment step, levels of similarity manifesting between the pixel of the first image corresponding to the pixel of the second image and the nearby pixels of the first image along at least two directions are judged by using color information corresponding to different color components present in the local area containing the pixel of the first image.
 29. An image processing method for converting a first image that is expressed in a colorimetric system made up of a plurality of color components and comprises a plurality of pixels each having color information corresponding to at least one of the color components into a second image that comprises a plurality of pixels each having at least a common type of color information that is not present in the first image, comprising: 1) a color difference information generation step in which color difference information is generated by using color information in the first image; 2) a color evaluation step in which a color evaluation is executed in units of individual pixels by using the color difference information; 3) a color difference information correction step in which the color difference information is corrected through a single type of correction selected from a plurality of types of correction based upon results of the color evaluation executed in the color evaluation step; and 4) an output step in which the second image is output by using the corrected color difference information, all executed for a processing target pixel in the second image.
 30. An image processing method according to claim 29, wherein: the plurality of types of correction include a first correction through which the color difference information that has been generated is corrected through wide-range low-pass filter processing and a second correction through which the color difference information that has been generated is corrected through narrow range low-pass filter processing; and in the color difference information correction step, the first correction is selected if the saturation level is judged to be low in the color evaluation and the second correction is selected if the saturation level is judged to be high in the color evaluation.
 31. An image processing method according to claim 29, wherein: the plurality of types of correction include a first correction through which the color difference information that has been generated is corrected through wide-range median filter processing and a second correction through which the color difference information that has been generated is corrected through narrow-range median filter processing; and in the color difference information correction step, the first correction is selected if a saturation level is judged to be low in the-color evaluation and the second correction is selected if the saturation level is judged to be high in the color evaluation.
 32. An image processing method according to claim 29, wherein: the color difference information corresponding to a position of a given pixel of the second image comprises a plurality of types of color difference information; and in the color evaluation step, the color evaluation is executed by taking into consideration a new type of color difference information generated through a combination of the plurality of types of color difference information.
 33. An image processing method according to claim 32, wherein: the first image is expressed in a colorimetric system that is made up of a first color component, a second color component and a third color component, with pixels corresponding to the first color component set with a higher pixel density than pixels corresponding to the second color component or pixels corresponding to the third color component; the plurality of types of color difference information include first color difference information comprising a difference between color information corresponding to the first color component and color information corresponding to the second color component and second color difference information comprising a difference between the color information corresponding to the first color component and color information corresponding to the third color information; and the new type of color difference information comprises a difference between the first color difference information and the second color difference information.
 34. An image processing method according to claim 29, wherein: in the color evaluation step, the color evaluation is executed by incorporating color difference information generated for nearby pixels through the color difference information generation step with the color difference information generated for the processing target pixel.
 35. An image processing method according to claim 29, wherein: in the color evaluation step executed during the color judgment step, the color difference information is corrected and the color evaluation is executed by using the corrected color difference information.
 36. An image processing method according to claim 35, wherein: in the color evaluation step executed during the color judgment step, low-pass filter processing is executed to correct the color difference information.
 37. An image processing method according to claim 36, wherein: the low-pass filter is a wide-range low-pass filter.
 38. An image processing method according to claim 29, further comprising: a similarity judgment step executed before the color difference information generation step, in which levels of similarity manifesting between a pixel of the first image corresponding to a pixel of the second image and nearby pixels of the first image along at least two directions are judged by using color information present in a local area containing the pixel of the first image, wherein; in the color difference information generation step, color difference information is generated in correspondence to a position of the pixel of the second image based upon judgment results obtained through the similarity judgment step.
 39. An image processing method according to claim 38, wherein: 1) in the similarity judgment step, the levels of similarity manifesting along the individual directions are each judged to be one of at least three different levels; and 2) in the color difference information generation step, the color difference information is generated by using the color information in the first image through one of at least three different methods each corresponding to specific judgment results obtained in the similarity judgment step.
 40. An image processing method for converting a first image that is expressed in a colorimetric system made up of a plurality of color components and comprises a plurality of pixels each having color information corresponding to at least one of the color components into a second image that comprises a plurality of pixels each having at least a common type of color information that is not present in the first image, comprising; 1) a luminance information generation step in which luminance information is generated by using color information in the first image; 2) a luminance evaluation step in which a luminance evaluation is executed in units of individual pixels by using the luminance information; 3) a second image generation step in which color information for the second image is generated by using the color information of the first image; and 4) a second image correction step in which the color information for the second image is corrected based upon results of the luminance evaluation executed in units of the individual pixels of the second image; all executed for a processing target pixel of the second image.
 41. An image processing method according to claim 40, wherein: in the luminance evaluation step, the luminance evaluation is executed by calculating a maximum value among values indicated in the luminance information of a plurality of pixels present within a local area containing the processing target pixel and a value representing a variance of the values indicated by the luminance information.
 42. An image processing method according to claim 41, wherein: 1) in the luminance evaluation step, one of two decisions that are a decision that a condition in which the maximum value and the variance value of the values indicated by the luminance information are each equal to or greater than a predetermined value is satisfied and a decision that the condition is not satisfied, is made; and 2) in the second image correction step, the color information for the second image is corrected through one of two different types of correction selected in conformance to the decision made with regard to the condition, or the color information is corrected only if the condition is satisfied.
 43. An image processing method according to claim 42, wherein: in the second image correction step, wide range median filter processing is executed if the condition is determined to be satisfied in the luminance evaluation and narrow-range median filter processing is executed if the condition is determined not to be satisfied in the luminance evaluation, or median filter processing is executed only if the condition is determined to be satisfied.
 44. An image processing program used to execute the steps of an image processing method according to any one of claims 1 through 43 on a computer.
 45. A computer-readable recording medium having recorded therein an image processing program according to claim
 44. 46. An image processing apparatus having installed therein an image processing program according to claim
 44. 